Forum Discussion

PGAT's avatar
PGAT
Icon for Helper III rankHelper III
5 years ago
Solved

Top N for each month

 

Hi PBI Community,  I have been using Top N for a while but yet today, I am stumped.  I have a report of our invoices which are issued by a team of many pple (e.g. Member 1, 2, 3, 4, 5 and so forth).  I want to chart out the billings by month but only show the TOP 5 (members) and thier billings.   When I put the member into filter/visual,  PBI took the top 5 for the entire year (Jan to Oct) and plotted out the invoices for the top 5.   This is not what I need.  I want to know who are the ones who make up the top 5 for Jan, the top 5 for Feb, and so on, and so forth.  

 

E.g. 

 

Jan 2020 -  M1, M3, M5, M7, M9, M4

Feb 2020 -  M2, M4, M5, M7, M9

 

Each month is possibly a different group of top 5. 

 

I hope someone can help guide me. Thank you. 

 

 

Sincerely,

Patrick

 

  • Hi, PGAT 

    According to your description and expected result, you can follow my steps:

    1. Create these measures:
    Rank =
    
    RANKX(
    
        FILTER(ALLSELECTED('Table'),
    
        [Year Month]=MAX([Year Month])),
    
        CALCULATE(MAX([Billing])),,
    
    DESC)

     

    No1 =
    
    CALCULATE(MAX([Member]),FILTER('Table',[Rank]=1))

     

    No2 =
    
    CALCULATE(MAX([Member]),FILTER('Table',[Rank]=2))

     

    No3 =
    
    CALCULATE(MAX([Member]),FILTER('Table',[Rank]=3))

     

    No4 =
    
    CALCULATE(MAX([Member]),FILTER('Table',[Rank]=4))

     

    No5 =
    
    CALCULATE(MAX([Member]),FILTER('Table',[Rank]=5))
    1. Create a Matrix chart, and place columns like this:

     

    And you can get what you want.

    You can download my test pbix file here

     

     

    Best Regards,

    Community Support Team _Robert Qin

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

5 Replies