Forum Discussion
TopN per Month
I have a table which contains data for tasks logged for different projects. This is a sample of the data
I've tried plotting the number of tasks logged per month and broken it down by project as legend.
x axis: Request Date
y axis: Count of Task ID
Legend: Project Name
Since there are hundreds of projects I only wanted to display the top 5 but PowerBI displays the top 5 overall and not the top 5 for each month. I want to be able to see the top 5 projects that have logged tasks for that month and not top 5 for the entire year.
1 Reply
- amitchandak
Super User
Anonymous , TOPN should help
Use TOPN measure in place of your measure
CALCULATE([meausre],TOPN(5,all(Table[Project]),[Measure],DESC),VALUES(Table[Project]))
TOPN: https://youtu.be/QIVEFp-QiOk
or
https://www.sqlbi.com/articles/filtering-the-top-3-products-for-each-category-in-power-bi/