Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
geeksforfun
Frequent Visitor

how can I show top 3 data with a combined categories?

Hi community,

  I am quite new in Power BI and DAX. Currently I generated a table that shows in which month, which api has which exception and the total count for that exception. A typical data is like this: 

  April , user/getresource, SystemException, 4000. 

  So there are 4 columns, month, api, exception and the count for that exception. the table is a little bit big. Is there any way that I can only show the top 3 exceptions per month and per api? like in April, there are 12 kind of exceptions happened for user/getresource, but I only want to show top 3 exceptions.

  Really thank you for your help!

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

@geeksforfun,

 

You may refer to the following DAX that creates a new table.

top 3 =
FILTER (
    Table1,
    RANKX (
        CALCULATETABLE ( Table1, ALLEXCEPT ( Table1, Table1[month], Table1[api] ) ),
        Table1[count],
        ,
        FALSE (),
        DENSE
    )
        <= 3
)
Community Support Team _ Sam Zha
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

3 REPLIES 3
v-chuncz-msft
Community Support
Community Support

@geeksforfun,

 

You may refer to the following DAX that creates a new table.

top 3 =
FILTER (
    Table1,
    RANKX (
        CALCULATETABLE ( Table1, ALLEXCEPT ( Table1, Table1[month], Table1[api] ) ),
        Table1[count],
        ,
        FALSE (),
        DENSE
    )
        <= 3
)
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Really thank you, this is what I want

Hi Community,

    I am quite new with Power BI and DAX and need some help to deal with table. Really thank you if you can help. 

    I currently have a table that four columns, Month, API, exception and count, one row is like this:

    May  user/getResource   System.Exception   4000

    This row  means that in May, for API named user/getResource, exception named System.Exception happened 4000 times. Currently I generated a table that shows all exceptions, but there are too many kind of exception and some of them happened less than 10 times per month which are not quite important.

   So my question is, how can I only show the top 3 exceptions per month and per API in the table?

   Really thank you for your help!

 

Thanks,

Peter

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.