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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
seemak
Frequent Visitor

count the number of categories (a single row has multiple categories) in a column

Hi 

Could anyone tell me how to create a column with the count of categories in the highlighted column

100033Liquid Lounge1INR74.8466612.87074           Finger Food, Continental, North Indian
100044Village Restaurant1INR74.8594612.89898           Chinese, Continental, North Indian, Mughlai
1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @seemak ,

 

You can try a custom column with the following code:

 

List.Count(Text.Split([categoryColumn], ","))

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

3 REPLIES 3
seemak
Frequent Visitor

Thank you so much Pete, it worked , but we need to remove the +1

I created the custom column      List.Count(Text.Split([Cuisines],",")) and it worked perfectly

seemak_0-1642061394137.png

 

Ah, yes.

I got confused with something else I was doing counting delimiters.

I'll amend my original answer so it's correct for future viewers.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




BA_Pete
Super User
Super User

Hi @seemak ,

 

You can try a custom column with the following code:

 

List.Count(Text.Split([categoryColumn], ","))

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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