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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
pkumar
Frequent Visitor

Top 5 and everything else other

Job Title.PNGJob Title Pie Chart.PNG

 

My pie chart shows the percentage of each job title based on count. I only want to show the top 5 though, and I want everything else to be show in something called "Other". I want this to be dynamic, meaning the top 5 could change if I uploaded new data.

1 ACCEPTED SOLUTION
Eric_Zhang
Employee
Employee

@pkumar

AFAIK, it is not supported in a visual setting, but you can create a calculated column as a workaround.

 

category_ =
IF (
    CONTAINS (
        TOPN (
            3,
            SUMMARIZE ( 'table', 'table'[category], "cnt"COUNTA ( 'table'[category] ) ),
            [cnt], DESC
        ),
        'table'[category], 'table'[category]
    ),
    'table'[category],
    "other"
)

Capture.PNG

View solution in original post

2 REPLIES 2
Eric_Zhang
Employee
Employee

@pkumar

AFAIK, it is not supported in a visual setting, but you can create a calculated column as a workaround.

 

category_ =
IF (
    CONTAINS (
        TOPN (
            3,
            SUMMARIZE ( 'table', 'table'[category], "cnt"COUNTA ( 'table'[category] ) ),
            [cnt], DESC
        ),
        'table'[category], 'table'[category]
    ),
    'table'[category],
    "other"
)

Capture.PNG

It worked! Thanks!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.