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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
TomJWhite
Frequent Visitor

Bin values for visual (Top 5 + 'Other') sorting

Hi there,

 

I have a donut visual showing total viewing hours for tv shows in my dataset. I created groups so that I could group shows not in the top 5 as 'Other'. I was hoping to move the 'Other' category to the end of the visual (ie the left) so that it comes after the top 5 results despite being the largest group in this instance. How would I go about this? (Also cant seem to force that last label to show but that seems to just be a pbi 'quirk'

 

TomJWhite_1-1628734002094.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @TomJWhite ,

 

Below is the sample data and solution created by myself.

ValueID

600 A
300 B
400 C
500 D
250 E
350 F

 

1.Create a rank column

Rank = RANKX('Table',[Value],,DESC,Dense)

7.png

 

2.Create the following table by entering data

5.png6.png

 

3.Create the following measure

Measure =
IF (
    MAX ( 'Table (2)'[Top N] ) = "Others",
    CALCULATE ( SUM ( 'Table'[Value] ), FILTER ( ALL ( 'Table' ), [Rank] > 5 ) ),
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER ( 'Table', [Rank] = VALUE ( MAX ( 'Table (2)'[Top N] ) ) )
    )
)

8.png

9.png

You can check more details from the attachment.

 

 

Best Regards,

Stephen Tao

 

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
Anonymous
Not applicable

Hi @TomJWhite ,

 

Below is the sample data and solution created by myself.

ValueID

600 A
300 B
400 C
500 D
250 E
350 F

 

1.Create a rank column

Rank = RANKX('Table',[Value],,DESC,Dense)

7.png

 

2.Create the following table by entering data

5.png6.png

 

3.Create the following measure

Measure =
IF (
    MAX ( 'Table (2)'[Top N] ) = "Others",
    CALCULATE ( SUM ( 'Table'[Value] ), FILTER ( ALL ( 'Table' ), [Rank] > 5 ) ),
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER ( 'Table', [Rank] = VALUE ( MAX ( 'Table (2)'[Top N] ) ) )
    )
)

8.png

9.png

You can check more details from the attachment.

 

 

Best Regards,

Stephen Tao

 

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

amitchandak
Super User
Super User

@TomJWhite , refer if these two can help

https://www.proserveit.com/blog/ms-power-bi-topn-and-other

https://www.youtube.com/watch?v=UAnylK9bm1I

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors