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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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