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
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
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.