Forum Discussion
esims123
2 years agoRegular Visitor
Help with Top N
I want to have the top 5 sites appearing within my dataset by each month. Currently I can only get the top 5 appearing overall rather than depending on month. The collumn "Created" is the da...
- Anonymous2 years ago
Hi esims123 ,
Please try this:SiteTop5 = VAR _table = GENERATE ( ALLSELECTED ( 'Heater Callout Data'[Created].[Month] ), TOPN ( 5, ALLSELECTED ( 'Heater Callout Data'[Site] ), COUNT ( 'Heater Callout Data'[Site] ) ) ) VAR _result = CALCULATE ( COUNT ( 'Heater Callout Data'[Site] ), KEEPFILTERS ( _table ) ) RETURN _resultBest Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group
amitchandak
2 years agoSuper User
esims123 , use a measure created with TOPN or window
CALCULATE([meausre],TOPN(5,all(Table[site]),[Measure],DESC),VALUES(Table[site]))
Learn Power BI: Dynamic TOPN using TOPN/Window and Numeric parameter: https://youtu.be/vm2mdEioQPQ