I am creating a pivot table in quicksight, one of the rows I want to calculate the average so I have applied avaerage option on it. It aggregates it up to the root level 500/6 = 83.333 so far so good.
Now I want to tweak this a bit and instead of showing 83.333, I want to show it as fraction value like 5/6, it basically denotes 5 are passed out of 6. How I can achive the same ?
Unfortunately, as far as I know, QuickSight doesn't provide any such functionality out of the box. What you can do instead is get a total count of all the objects in the table and another count of the items that have passed and then display them one after another.
Related
I am currently creating a pivot table in Quicksight which I am looking to create a Field Well with a series of numbers from 1 to 100. They should be static and not effect the data in the table though. I have managed to do this in PowerBI before using the GENERATESERIES function.
Assuming you have 100 rows in your table, you could create a calculated field that uses denseRank() to assign every row a number from 1 to 100. You would need to make sure you rank on field(s) that do(es) not have duplicates. An index-based rank could work, for example.
I have posted the images, with the filter i have applied to the rows. I would get the difference value as 10 .
This link offers guidance on how to compare two filtered cards.
Summary:
Re-create table twice for each set of cards (How to create calculated table).
Create a measure for each card, e.g. Measure1 = CALCULATE(SUM(TableForCard1[Col]))
Create a measure for the difference, e.g. Diff = [Measure1]-[Measure2]
You could create measures for each individual card that includes the filters that you added to them. And then you would just have to subtract the two measures from each other to get your last value.
I am working on QuickSight in AWS. I am trying to achieve weighted average value in a Pivot table.
I am using SPICE data to create this analysis.
I have created a calculate field (WAM) in analysis with formula "percentOfTotal(sum(upb),[{pool_num}]) * sum({remaining_terms})".
This gives me the desired value on each row level, but the sub total of a particular column is not reflecting the total of values in the calculate field, rather it displays the sum of original values in the "remaining_terms" field.
Please see below image for the same. Can some one please through some light on this ?
Thanks in advance for your help
Please note that I have tried the same in Excel pivot table and it works perfectly.
Try to remove the 2nd argument from the percentOfTotal function. For example, just do:
percentOfTotal(sum(upb))
I am not 100% this will work but one thought it that it would match the remaining_terms value if the percentageOfTotal was 1 (i.e. 100%) and you may not need to provide a partition argument in a pivot table since pivot tables implicitly provide partitions.
I have solved the problem in a different way. See below what I have done.
WAM = percentOfTotal(sum(upb),[{pool_num}]) * sum({remaining_terms}).
It looks like QuickSight treats the subtotal as a row and the above function is applied on the subtotal, hence it is converted as
(1186272.5 / 1186272.5) * 31 = 31.
I have tried to produce the desired result by introducing another custom field with formula
SUM_WAM = sumOver({WAM},[{pool_num}]).
This gives me the output I need, but in a column. See the screen shot attached
I am looking to create a custom calculation for a visualization in Power BI. In particular, I am looking to get a weighted average of my data.
My data set looks something like this:
Cluster Name | Node | Call Name | Errors | Calls
I would like to make a dashboard where I'm giving the percent error over time based on filters on the level of Cluster Name, Node, Call Name, or some combination of these. (The cluster name being the most broad and the call name being the least broad.)
I can easily set up a SQL query that gives me the percent error for each of these categories by doing SUM(Errors)/Sum(Calls) grouped by the category used and this is what I would like to replicate in my visualization.
The reason why I cannot simply calculate the percent error for the broader categories by taking an average of the simpler categories is that not every Call Name has an equal number of Calls. Therefore, I have to use a weighted average or simply recalculate SUM(Errors)/Sum(Calls) for each category selection.
I have tried to accomplish this using a custom column using DAX, but the numbers that the column calculates make no sense. My formula is PercentError = DIVIDE(MyTable[Errors], MyTable[Calls],0)*100, but the calculation seems to give really off numbers. For example, one row has 45 errors and 48 calls, but the percent error is listed as 2630.
Is there a way to do this through the visualization and/or the custom column calculations?
You can do this using a calculated measure rather than a calculated column. The formula would be exactly what you have described in your post
=SUM(Table[Errors])/SUM(Table[Calls])
Format as a % in the Modelling tab and voila.
Put your new measure in the values of a visual like a Matrix and put whatever columns you want to slice and dice this by in the Rows or Columns.
I am working on a report that has data by month. I have created a measure that will calculate a cost per unit which divides the sum of dollars by the sum of production volume for the selected month(s):
Wtd Avg = SUM('GLData - Excel'[Amount])/SUM('GLData - Excel'[Production])
This works well and gives me the weighted average that I need per report category regardless of if I have one or multiple months selected. This actual and budget data is displayed below:
If you take time to total the actual costs you get $3.180. Where I am running into trouble is a measure to sum up to that total for a visual (This visual does not total sadly). Basically I need to sum the aggregated values that we see above. If I use the Wtd Avg measure I get the average for the total data set, or .53. I have attempted another measure, but am not coming up with the correct answer:
Total Per Unit Cost = sumX('GLData - Excel','GLData - Excel'[Wtd Avg])/DISTINCTCOUNT('GLData - Excel'[Date])
We see here I return $3.186. It is close, but it is not aggregating the right way to get exactly the $3.180:
My Total Per Unit Cost formula is off. Really I am simply interested in a measure to sum the post aggregated Wtd Avg measure we see in the first graph and total to $3.180 in this example.
Here is my data table:
As you probably know already, this is happening because measures are dynamic - if you are not grouping by a dimension, they will compute based on the overall table. What you want to do is to force a grouping on your categories, and then compute the sum of the measure for each category.
There are 2 ways to do this. One way is to create a new table in Power BI (Modeling tab -> New Table), and then use a SUMMARIZE() calculation similar to this one to define that table:
SUMMARIZE('GLData - Excel',[Category],[Month],[Actual/Budget],"Wtd Avg",[Wtd Avg])
Unfortunately I do not know your exact column names, so you will need to adjust this calculation to your context. Once your new table is created, you can use the values from that table to create your aggregate visual - in order to get the slicers to work, you may need to join this new table to your original table through the "Manage Relationships" option.
The second way to do this is via the same calculation, but without having to create a new table. This may be less of a hassle. Create a measure like this:
SUMX(SUMMARIZE('GLData - Excel',[Category],[Month],[Actual/Budget],"Wtd Avg",[Wtd Avg]),[Wtd Avg])
If this does not solve your issue, go ahead and show me a screenshot of your table and I may be able to help further.