Forum Discussion
Anonymous
8 years agoNot applicable
Top N with Total for all values
Hi, I feel this is simple - I have searched but cannot find a clear answer. Apologies if this is rather simplistic but this is relatively new to me. I want to show the Top 20 products by some value...
- 8 years ago
Hi Anonymous
Try this...
1. This is my sample data.
2. and this is the result after apply TopN (In my case Top 3)
3. The trick for showing the total below the table is the next measure...
Total Quantity = IF ( HASONEVALUE('Top'[Products]); SUM('Top'[Quantity]); CALCULATE(SUM('Top'[Quantity]);ALL('Top'[Products])) )I hope this helps
Regards
BILASolution
BILASolution
Solution Specialist
8 years agoHi Anonymous
Try this...
1. This is my sample data.
2. and this is the result after apply TopN (In my case Top 3)
3. The trick for showing the total below the table is the next measure...
Total Quantity =
IF
(
HASONEVALUE('Top'[Products]);
SUM('Top'[Quantity]);
CALCULATE(SUM('Top'[Quantity]);ALL('Top'[Products]))
)
I hope this helps
Regards
BILASolution
Anonymous
8 years agoNot applicable
Thanks, worked like a charm! :) (although I did have to change your semi-colons ; to commas , )