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

Displaying Top 10 AND "All Other"

What is the easiest way to bring forward top 10 and also show everything else in an "Other" category?   Example, I have a list of zip codes.   I want to display the top 10 zip codes of responders; I then want to group together not top 10 into "Other" category as one line item to show the total count and total % on one line.

 

Capture.PNG

7 REPLIES 7
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

I have made a sample to reproduce your scenario.

 

You could create the below measures to get the output.

 

total = SUM(Table1[Value])

Rnak =
VAR rank_ =
    RANKX ( ALL ( Table1 ), [total],, DESC )
RETURN
    IF ( rank_ > 10, "others", rank_ )

zip =
VAR zip =
    CALCULATE ( SELECTEDVALUE ( Table1[Zip codes] ) )
RETURN
    IF ( [Rnak] > 10, "others", zip )

output.PNG

 

You could modify the measures based on your scenario, if you still need help, please share your desired output so that we can help further on it.

 

Best  Regards,

Cherry

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

I tried using the information below, but couldn't figure it out.   Here is what I am working with.   Please note this table is the result of survey responses.   I limited the table with question id "5783" which is the zip code information.   I eliminated the other survey questions and answers to make it easier to work with.   

 

H2 POC PBI

H2 POC.xls

Hi @Anonymous,

 

If I understand your requirement correctly that you want to rank by the count to show the top 10 zip codes and show everything else in an "Other".

 

If it is, please try this measure below.

 

Measure =
VAR rank_ =
    RANKX (
        ALLSELECTED ( 'page' ),
        CALCULATE ( COUNT ( 'page'[Survey Answer Text] ) ),
        ,
        DESC,
        DENSE
    )
RETURN
    IF ( rank_ > 10, "other", rank_ )

 

If you still need help, please share your desired output so that I can understand your requirement better.

 

Best  Regards,

Cherry

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

This is much closer.   I made a few changes to get what I need, however, how can the category "other" roll up into one line item to show one total count and total %.   e.g, 

 

Count      Measure     Zip         %

   200              1          Other     25%

 

In other words, 200 entries were identified as unique, they fall within the measure of "1" because there are no duplicates, they fall under the Zip category as "Other because they are a conglomerate of different zip codes, but all total, they make up 25% of the total count of zip codes.   

 

I've attached the latest file for review.   H2 POC

 

Thanks for your help.

Anonymous
Not applicable

In a nutshell, here is the desired outcome I am looking to create.    All rows that meet the 'Other' criteria are summed onto one line.   A '% Ttl' and 'Count' are created based on the calculation of 'Other'.

 

CaptureCR.PNG

Hi @Anonymous,

 

Please refer to my attached simple pbix which has reproduced your scenario.

 

Best Regards,

Cherry

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

Thanks Cherry,  I have tried using the formulas you provided FROM the "mock-up" example.   I spent a lot of time integrating that into my actual PBIX.   I now have uploaded the actual table; would you mind showing me how to apply the formulas to the actual file.    The actual XLS file is a larger file; which is why I created a small mockup file.   And the design of the PBIX is a little different.

H2_POC_V3.XLS

H2_POC_V3a.PBIX

 

Thanks in advance.

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.