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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
LP280388
Resolver II
Resolver II

Power Query - how to get count of comma delimited values from a column

Hi Team, 

I have a table with a column which has comma seperated values as below. 

I'm trying to add a column to show count of these delimited values.  for example: below has 49 delimited values. the column should show 49 next to this column.  

AL, AZ, AR, CA, CO, CT, DE, DC, FL, GA, HI, ID, IL, IN, IA, KS, KY, LA, ME, MD, MA, MI, MN, MS, MO, MT, NE, NV, NH, NJ, NM, NY, NC, ND, OH, OK, OR, PA, RI, SC, SD, TN, TX, VT, VA, WA, WV, WI, WY

 

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@LP280388,

 

In Power Query, try this in a custom column:

 

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

 

DataInsights_0-1662395319159.png

 





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

Proud to be a Super User!




View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

This calculated column formula works

=LEN(Table1[Text])-LEN(SUBSTITUTE(Table1[Text],",",""))+1

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
DataInsights
Super User
Super User

@LP280388,

 

In Power Query, try this in a custom column:

 

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

 

DataInsights_0-1662395319159.png

 





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

Proud to be a Super User!




@DataInsights Thank you very much for such a easy step.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.