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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

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

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.