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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Perform a top occurrence of names present in several columns

Hy everyone, 

I'm new at Power BI and I would like to get a top 5 occurrence of names present in 5 different columns. I will use the "tab" graph in power BI, I tried with Power BI command in vain.

 

To do this, I tried to create a "mega column" containing the 5 initials, and filtering the empty cells. I did not succeed. For information, I unfortunately cannot change the form of the input excel. 
I'm looking for any kind of solution, directly in Excel or Power BI
Can you please help me to achieve this? Thank you in advance 🙂

coca0sucre_1-1737371391919.png

coca0sucre_2-1737371460693.png

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

When having some empty cell, select 5 columns, right click and choose unpivot columns.

vjiewumsft_0-1737619259091.png

Rename the column name.

vjiewumsft_1-1737619279544.png

Close and apply. Drag the name column to the visual and set Top N in the Filters pane.

vjiewumsft_2-1737619298463.png

 

Best Regards,

Wisdom Wu

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

9 REPLIES 9
Anonymous
Not applicable

Hi @Anonymous ,

Based on the testing, importing the excel file to power bi desktop and select transform.

vjiewumsft_0-1737527905698.png

Select columns that want to concatenate. Go to the add column and select custom column.

vjiewumsft_1-1737527920192.png

In the dialog, enter the following formula.

 

[Column1] & "," & [Column2] & "," & [Column3] & "," & [Column4] & "," & [Column5]

 

vjiewumsft_2-1737527942979.png

Go to the Home tab, select split column > by delimiter. Choosing the comma.

vjiewumsft_3-1737527949565.png

vjiewumsft_4-1737527955882.png

Select 5 columns and remove columns.

vjiewumsft_5-1737527963549.png

Close and apply.

vjiewumsft_6-1737527972482.png

Then, using the following DAX formula to create a new column. Drag the column to the table visual.

 

Column = COUNTAX(FILTER('Table', 'Table'[Custom] = EARLIER('Table'[Custom])), 1)

 

vjiewumsft_7-1737527979726.png

Sort the visual by the name and apply a Top 5 fitler.

vjiewumsft_8-1737527995185.png

Best Regards,

Wisdom Wu

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

Anonymous
Not applicable

 
 
 
Anonymous
Not applicable

Hi @Anonymous ,

When having some empty cell, select 5 columns, right click and choose unpivot columns.

vjiewumsft_0-1737619259091.png

Rename the column name.

vjiewumsft_1-1737619279544.png

Close and apply. Drag the name column to the visual and set Top N in the Filters pane.

vjiewumsft_2-1737619298463.png

 

Best Regards,

Wisdom Wu

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

 

Anonymous
Not applicable

It's working very well.
Thank you for all 🙂 

Anonymous
Not applicable

Hi , thank you for your response, 
I think it may be working but I have some empty cell and it does not merge for this rows: the concatenete cells appears empty

 
Anonymous
Not applicable

I also have empty cells inside my test data and it works fine. Can you provide some sample data as text rows yes? The file link does not open.

 

Best Regards

Wisdom Wu

 

Anonymous
Not applicable

Hi, here it is, this is exactly what it's look like after I deleted all the other columms. 

I only anonymized the last names.
 
 
thank you for your help
EE 1EE 2EE 3EE 4EE 5
Bénedicte SClaire BDenis Stéphane B 
Olivier HThierry HPatrick A  
Jean-Luc M    
Serge CGilles MFrançois DPatrick RJean-Michel T
Olivier M   Bénedicte S
Fabrice BGabriel CEMILIENLudivine LBénedicte S
Bruno VPatrice DLise BBéatrice Du B 
Bertrand FOlivier HJean-Michel H  
Lise LNans FPaul Jun MFranck BStanislas F
Denis FStéphane BSébastien RBénedicte SEvangéline B
Damien L  Bénedicte SBénedicte S
Olivier H    
Jean-Luc     
Serge C    
Olivier M    
Fabrice B    
Bruno V    
Bertrand F    
Lise L    
Denis F    
     

 

audreygerred
Super User
Super User

Can you please upload the pbi file with the excel, even if it is dummy data, that is fine 🙂





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors