Forum Discussion

TomJWhite's avatar
TomJWhite
Frequent Visitor
5 years ago
Solved

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'

 

 

  • Anonymous's avatar
    Anonymous
    5 years ago

    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)

     

    2.Create the following table by entering data

     

    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] ) ) )
        )
    )
    

    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.

2 Replies