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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

TOP N and "OTHERS" values

Hi good morning!

 

I have a problem creating a Dax Formula in PowerBI.

I have two fields, one of "Consume" and another one is a "Cost x Consume".

 

The problem is that there are many types of consume which leaves the graphic very polluted.

What I would like to do to show all types of consume is to use a TopN 5, 10 .. filter where the most expensive types of consume appear and in the end a "grouping of all other consumptions" in only one with the name of others.

 

An image to leave more detailed my doubt:

 

problema-a-resolver

 

 

I'm sorry for my bad english.

 

Thank you!

 

1 ACCEPTED SOLUTION
v-cherch-msft
Employee
Employee

Hi @Anonymous

 

You may create the new type column and drag it to 'Legend'. For example: Show the top 3 values in Donut chart.

Rank =
RANKX (
    ALL ( Table2[type] ),
    CALCULATE ( SUM ( Table2[value] ), ALLEXCEPT ( Table2, Table2[type] ) )
)
NewType = IF(Table2[Rank]<=3,Table2[type],"Others")

1.png

 

Regards,

Cherie

Community Support Team _ Cherie Chen
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

5 REPLIES 5
v-cherch-msft
Employee
Employee

Hi @Anonymous

 

You may create the new type column and drag it to 'Legend'. For example: Show the top 3 values in Donut chart.

Rank =
RANKX (
    ALL ( Table2[type] ),
    CALCULATE ( SUM ( Table2[value] ), ALLEXCEPT ( Table2, Table2[type] ) )
)
NewType = IF(Table2[Rank]<=3,Table2[type],"Others")

1.png

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

@v-cherch-msft  i am using your solution and wanted to extend the funtionality by providing a TopN menu, like so 

image.png

 

and change 'New Type' like so

New Type = IF(Sheet1[Rank] <= max('TopN'[TopN]); Sheet1[type];"Others")

I dont get any errors but the donut chart just doesn't react to the selected value.  Thx in advance

Anonymous
Not applicable

Thank you very much! It worked!

Anonymous
Not applicable

Hi Pedro,

Perhaps this tutorial help you to achive your needs.... and it's in Spanish.

 

Tell us if works for you.

 

 

 

This is very elegant. 11:00 if anyone want's a timestamp, but the whole vid is gold

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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