cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CountingPeople
Frequent Visitor

Top 5 in a month

Hi all


Think I might have gotten a bit rusty!

I need to show a table with months in the columns with the top 5 accounts in each. It could be, that the same account shows up twice since it is in the top 5 for more than one month.

 

This works well with a column with only one month, RANKX() does the job. But when I use it combination with multiple months, I cannot filter for TOPN in the Matrix visual.

See picture below what the end result should look like:

Coverage.png
Anybody have an idea how to achieve this?

Tried a calculated table as well... but might be overkill?

Thanks for the help!

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @CountingPeople ,

Do you mean that the top 5 accounts in mid-October will not appear in mid-November. Re-sort them?

Or the account that appeared in mid-October will also appear in the follow-up:

Measure =
var _rank=
RANKX(
    FILTER(ALL('Table'),MONTH('Table'[Date])=MONTH(MAX('Table'[Date]))),
    CALCULATE(SUM('Table'[Amount])),,DESC)
return
IF(
    _rank <=5,MAX('Table'[Amount]) ,BLANK())

vyangliumsft_0-1666680118329.png

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.

 

Best Regards,

Liu Yang

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

View solution in original post

2 REPLIES 2
CountingPeople
Frequent Visitor

Hi @v-yangliu-msft thank you! that worked like a charm

v-yangliu-msft
Community Support
Community Support

Hi  @CountingPeople ,

Do you mean that the top 5 accounts in mid-October will not appear in mid-November. Re-sort them?

Or the account that appeared in mid-October will also appear in the follow-up:

Measure =
var _rank=
RANKX(
    FILTER(ALL('Table'),MONTH('Table'[Date])=MONTH(MAX('Table'[Date]))),
    CALCULATE(SUM('Table'[Amount])),,DESC)
return
IF(
    _rank <=5,MAX('Table'[Amount]) ,BLANK())

vyangliumsft_0-1666680118329.png

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.

 

Best Regards,

Liu Yang

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

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors