Forum Discussion
raj777karthik
Microsoft Employee
4 years agoTOPN dax function as variable
Need to show top 5 services in table visual. Service Name Count Total Count Apple 43 346 Samsumg 67 346 mi 80 346 oppo 84 346 google 72 346 Measure written we...
- 4 years ago
v-yadongf-msft
Community Support
4 years agoHi raj777karthik ,
This is my test table:
Please try following DAX to create a new table:
New Table = TOPN(5,SUMMARIZE('Stack Tags','Stack Tags'[Service],'Stack Tags'[Thread__]),'Stack Tags'[Thread__],DESC)
Then create a measure to calculate total count:
Total count = CALCULATE(SUMX('New Table',CALCULATE(SUM('New Table'[Thread__]))),ALL('New Table'))
You will get result you want:
If I misunderstand your demands, please feel free to contact us in time.
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.