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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
kingy614
Regular Visitor

Count values with delimiter

I have a data set like below:

Column 1Column 2
PLF

ARM

PLFLEG
PLFARM, LEG
STATICARM

 

I created a heirarchy with both columns in which Column 1 is first. I want to have Column 2 be split by the comma delimiter so when you drill down in the chart for PLF is shows the count of each value accurately. I can get Colunm 2 to display ARM, LEG, and ARM, LEG with each being a count of 1. I want to show ARM and LEG seperatly with the count of ARM being 2 and LEG being 2 for PLF.

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@kingy614 

you can try to split delimiter to rows in PQ

 

11.png12.png





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

Proud to be a Super User!




View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

In Power Query, you can split the column by rows using , as a delimiter.


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

@kingy614 

you can try to split delimiter to rows in PQ

 

11.png12.png





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

Proud to be a Super User!




Greg_Deckler
Community Champion
Community Champion

@kingy614 In Power Query, split by delimiter and then unpivot like so:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCvBxU9JRcgzyVYrVgfF8XN2ReEA5HQWYUHCIY4inM0xHLAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Column 1" = _t, #"Column 2" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column 1", type text}, {"Column 2", type text}}),
    #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(#"Changed Type", {{"Column 2", Splitter.SplitTextByDelimiter(", ", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Column 2"),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Column 2", type text}})
in
    #"Changed Type1"


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

I copied and pasted the code and that did work but how would I use this with a SharePoint Online list? Is there anything I need to change in the code to use the SharePoint Online list?

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.

Top Solution Authors
Top Kudoed Authors