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
Hugo06
New Member

Count of name in multiple columns

Hi everyone,

I am a beginer in PowerBI and i struggle on the following point.

 

Here is an example of the data that I have :

Name 1Name 2Name 3
JeanPeter 
PeterJean 
DanielJean 
MikeEvanJean

 

I would like to count how many time each name appear in one of the 3 collumns and vizualize this in a pie chart.
On the exemple here, the result should be :

Jean : 4

Peter : 2

Daniel : 1

Mike : 1 

Evan : 1

 

Could you please help me to figured out how to do it with a measure ? 

 

Thanks in advance for your help.

1 ACCEPTED SOLUTION
pratyashasamal
Super User
Super User

Hi @Hugo06 ,
Select the three name columns and under the Transform tab select Unpivot Columns, Unpivot Only Selected Columns

pratyashasamal_0-1689781701366.png

right click on the value column and select Split Column, By Delimiter

pratyashasamal_2-1689781701861.png

split by comma and under the Advanced options choose Split into Rows

Trim the resulting value column (Transform -> Format -> Trim)

Filter out blanks from the value column .

You can now Close & Apply.
Now you can use COUNT and create visual out of this.

CountName = COUNT(NameTable[Value])

 


Thanks,
Pratyasha Samal
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C





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

Proud to be a Super User!





View solution in original post

2 REPLIES 2
VilmarSch
Post Patron
Post Patron

Uma alternativa seria transformar colunas em linhas no Power Query, depois uma medida dax

Sem título.png

 

Contar = COUNT(Tabela1[Valor])

Sem título.png

pratyashasamal
Super User
Super User

Hi @Hugo06 ,
Select the three name columns and under the Transform tab select Unpivot Columns, Unpivot Only Selected Columns

pratyashasamal_0-1689781701366.png

right click on the value column and select Split Column, By Delimiter

pratyashasamal_2-1689781701861.png

split by comma and under the Advanced options choose Split into Rows

Trim the resulting value column (Transform -> Format -> Trim)

Filter out blanks from the value column .

You can now Close & Apply.
Now you can use COUNT and create visual out of this.

CountName = COUNT(NameTable[Value])

 


Thanks,
Pratyasha Samal
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C





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

Proud to be a Super User!





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.