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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
CSNG_81
New Member

How to find out which are the 3 elements that are repeated the most in a column and substitute them

How to find out which are the 3 elements that are repeated the most in a column and finally group the remaining elements as "other motivators" in Power BI?
I have a motivators column with several motivators, but I want to know only the 3 main motivators in this column and group the other elements as "other motivators". How would I make this discovery of knowing which 3 appeared the most and grouping the others together? Because the most repeated motivators will eventually change, there is a formula to solve this.

1 REPLY 1
Fowmy
Super User
Super User

@CSNG_81 

Please find attached the file below:

Fowmy_0-1701981802708.png

Added a column:

Rank = 
VAR __CurrentMotivaor = 'Table'[Motivator]
VAR __T =  SUMMARIZE( 'Table' , 'Table'[Motivator], "@Count" , COUNT( 'Table'[Motivator] ) )
VAR __T2 = ADDCOLUMNS(__T,	"Rank" , RANK( DENSE , __T , ORDERBY( [@Count] , DESC ) )) 
RETURN
    SWITCH(
        TRUE(),
        __CurrentMotivaor IN SELECTCOLUMNS( FILTER( __T2 , [Rank] = 1 )  , 'Table'[Motivator] ) , "Top 1",
        __CurrentMotivaor IN SELECTCOLUMNS( FILTER( __T2 , [Rank] = 2 ) , 'Table'[Motivator] )  , "Top 2",
        __CurrentMotivaor IN SELECTCOLUMNS( FILTER( __T2 , [Rank] = 3 ) , 'Table'[Motivator] )  , "Top 3",
        "Other Motivators"
    )



 




Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.