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
NurAmirah_MY
Regular Visitor

Split data by comma

Hi,

I'm building a template dashboard for survey responses. There are multiple answer question where respondent can select more than answer. Hence, I want to show all the answers in chart. Please note that the responses data comes with , to seperate the answers. Eg: A, B, C, D

 

I have steps build up in power query. The steps are split the column by comma > unpivot selected column > the column can be used to chart the responses. Right now, the template has 4 columns from splitting up the response data (A | B | C | D). What if the survey has more than 4 multiple answers. When I refresh the power query that has data of 5 multiple answers, it didn't split up correctly instead it ignore. Eg: A, B, C, D, E and when split up the column it only shows until D. 

how to solve this? Thanks.

3 REPLIES 3
NurAmirah_MY
Regular Visitor

Hi @Fowmy 

 

Thanks for this solution. Will try in a bit.  Can I know when the power query run the split by column, if I want those columns after splitting to be unpivot, how can I do that?

@NurAmirah_MY 

Wihout having a sample data set, It's hard to assume and share a solution. 

Sharing a dummy Power BI file representing your scenario would be beneficial. You can save the Power BI file on Google Drive or any other cloud storage platform and provide the link here. Kindly ensure that permission is granted to open the file.

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Fowmy
Super User
Super User

@NurAmirah_MY 

You can split into ROWS under advanced:

Fowmy_0-1703847833060.png

 

Paste this code in a Blank Query and check the steps, add, more responses e,f,g


let

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



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

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.