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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Count Top 3 and Rest as Other

I have the below table, where I am trying to create visualization where I can get Top 3 Meeting Medium and Rest of the Meeting Medium's as "Other".
So, the top 3 as per the below data should be In Person, Virtual and On Phone while On Site and Null should reflect as Others.

DateMeeting Medium
9/8/2021In Person
9/9/2021Virtual
9/10/2021Virtual
9/11/2021On Site
9/12/2021Virtual
9/13/2021In Person
9/14/2021In Person
9/15/2021On Phone
9/16/2021On Phone
9/17/2021Virtual
9/18/2021On Phone
9/19/2021On Phone
9/20/2021Virtual
9/21/2021Virtual
9/22/2021Null
9/23/2021Null

 

For example: I need something like below:

patilmeet7_0-1635461999171.png

 

1 ACCEPTED SOLUTION
v-robertq-msft
Community Support
Community Support

Hi, @Anonymous 

According to your description, I can clearly understand your requirement, I think you can achieve your requirement by creating one single calculated column:

 

Category =

var _count=SUMMARIZE('Table','Table'[Meeting Medium],"Count",COUNT('Table'[Date]))

var _ranktable=ADDCOLUMNS(_count,"Rank",RANKX(_count,[Count],,DESC,Skip))

var _rank=MAXX(filter(_ranktable,[Meeting Medium]=EARLIER('Table'[Meeting Medium])),[Rank])

return

IF(_rank<=3,[Meeting Medium],"Others")

 

 

And you can get what you want, like this:

vrobertqmsft_0-1635754133294.png

 

Then you can create a stacked column chart to place it like this to get the result you wanted:

vrobertqmsft_1-1635754133299.png

 

You can download my test pbix file below

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

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

3 REPLIES 3
v-robertq-msft
Community Support
Community Support

Hi, @Anonymous 

According to your description, I can clearly understand your requirement, I think you can achieve your requirement by creating one single calculated column:

 

Category =

var _count=SUMMARIZE('Table','Table'[Meeting Medium],"Count",COUNT('Table'[Date]))

var _ranktable=ADDCOLUMNS(_count,"Rank",RANKX(_count,[Count],,DESC,Skip))

var _rank=MAXX(filter(_ranktable,[Meeting Medium]=EARLIER('Table'[Meeting Medium])),[Rank])

return

IF(_rank<=3,[Meeting Medium],"Others")

 

 

And you can get what you want, like this:

vrobertqmsft_0-1635754133294.png

 

Then you can create a stacked column chart to place it like this to get the result you wanted:

vrobertqmsft_1-1635754133299.png

 

You can download my test pbix file below

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

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

VahidDM
Super User
Super User

@Anonymous 

 

In addition to the below suggestion, you can add a new column to your table with this code:

New Group = 
VAR _A =
    RANKX (
        'Table',
        CALCULATE (
            COUNT ( 'Table'[Date] ),
            ALLEXCEPT ( 'Table', 'Table'[Meeting Medium] )
        ),
        ,
        DESC,
        DENSE
    )
RETURN
    IF ( _A < 4, [Meeting Medium], "Other" )

 

then use the new column in the visual.

Output:

 

VahidDM_1-1635464574719.png

 

 

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

Appreciate your Kudos!!

 

VahidDM
Super User
Super User

Hi @Anonymous 

 

Try this code to add a new table:

Table 2 = 
VAR _A =
    SUMMARIZE ( 'Table', 'Table'[Meeting Medium], "Count", COUNT ( 'Table'[Date] ) )
RETURN
    ADDCOLUMNS (
        ADDCOLUMNS ( _A, "Rank", RANKX ( _A, [Count],, DESC, DENSE ) ),
        "Group", IF ( [Rank] < 4, [Meeting Medium], "Other" )
    )

 

Output:

Use Group column in the visual.

VahidDM_0-1635464372544.png

 

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

Appreciate your Kudos!!

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.