Forum Discussion
TOPN sorting
- 5 years agoVolume total : =SUM(Volume[Volume])Top five volume measure : =CALCULATE ([Volume total :],KEEPFILTERS ( TOPN ( 5, ALL ( Items ), [Volume total :], DESC ) ))
If you check the documentation for TOPN (here and/or here), you may notice that it returns a table as its output, not a single value. A measure can only return a single value.
The easiest approach is usually to use the Top N filtering option in the filter pane.
See here too: https://community.powerbi.com/t5/Desktop/TopN/m-p/131646
Yeah, that's the easy way for us people in the office to do it. The goal is to make it go automatically by another measure that I have built to spit out a number for what I want the TOPN to be so on the user side they don't have to do anything and break the report or do god knows what. I wish in that TOPN i nthe filter pane I could just drag in the measure instead of having to manually input the number, but it is what it is.