Forum Discussion
diouckdiouck
1 year agoFrequent Visitor
TOPN by date with other category
hey there, I want to do a simple top 10 by date and cost as you can see below : However I want to add a "other" column that will contain the sum of cost for all the dates that we do not d...
- 1 year ago
Hi diouckdiouck
To create a Top N by Date visualization in Power BI that includes an "Others" category to sum the remaining data, follow these steps:
- Create a Rank measure to rank your dates based on the cost (or relevant metric).
DateRank = RANKX(ALLSELECTED('YourTable'[Date]), CALCULATE(SUM('YourTable'[Cost])), , DESC, DENSE) - Create a Category column to label the Top N dates and group the rest as "Others".
DateCategory = IF([DateRank] <= N, FORMAT('YourTable'[Date], "yyyy-mm-dd"), "Others") - Use the DateCategory in your visualization to display the Top N dates individually and aggregate the remaining dates under "Others".
If the above information helps you, please give us a Kudos and marked the Accept as a solution.
Best Regards,
Community Support Team _ C Srikanth. - Create a Rank measure to rank your dates based on the cost (or relevant metric).
Cookistador
Super User
1 year agoHello
this post explains you how to achieve that:
(I followed it a few months ago)
You can do it with the slicer, but you can achieve something similar in dax and use a numerical parameter
diouckdiouck
1 year agoFrequent Visitor
it works if I use a category but I want to do the TOPN by date.