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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

How to convert a comma separated text field from a column to count column of text field across rows

Hi 

I have a cuisines table having columns as below

Column Name : Cuisines

Row Values : (European,Arabian,Japanese,Bakery,Desserst)

 

I wan result in Another column like 

 

Cuisines                                                               -                 Count of Cuisines

European,Arabian,Japanese,Bakery,Desserst      -                        5

 

suparnababu_0-1676819136063.png

 

 

How can i get this results.

 

Can any one help me regarding this..?

 

Thanks in advance...

 

 

 

 

 

4 ACCEPTED SOLUTIONS
FreemanZ
Super User
Super User

hi @Anonymous 

try to add a calculated column like:

Count = 
LEN([Cuisines - Copy])
-
LEN( SUBSTITUTE([Cuisines - Copy], ",", ""))
+1

 

it worked like:

FreemanZ_0-1676819907923.png

View solution in original post

Anonymous
Not applicable

yes, my pleasure

1) the count of cuisine is count of comma+1

2) replacing comma with blank("") makes the list short. The shortage is the count of comma.

 

make sense?

View solution in original post

Ahmedx
Super User
Super User

also possible like this
2023-02-19_23-02-35.png

 

=PATHLENGTH(SUBSTITUTE([Cuisines - Copy],",","|"))

 

View solution in original post

5 REPLIES 5
Ahmedx
Super User
Super User

also possible like this
2023-02-19_23-02-35.png

 

=PATHLENGTH(SUBSTITUTE([Cuisines - Copy],",","|"))

 

Anonymous
Not applicable

Thank you @FreemanZ  Got it

Anonymous
Not applicable

Hi @FreemanZ  Can you share detailed expalantion for understanding purpose..

yes, my pleasure

1) the count of cuisine is count of comma+1

2) replacing comma with blank("") makes the list short. The shortage is the count of comma.

 

make sense?

FreemanZ
Super User
Super User

hi @Anonymous 

try to add a calculated column like:

Count = 
LEN([Cuisines - Copy])
-
LEN( SUBSTITUTE([Cuisines - Copy], ",", ""))
+1

 

it worked like:

FreemanZ_0-1676819907923.png

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Kudoed Authors