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
Anonymous
Not applicable

Mutiple answer question in power BI

 

Dears,

please i need your help where i am not sure how to visualize multiple answers question, where each respondent has more than answer that were entered in a different column, for ex answer 1 in col 1 and answer 2 in col 2,etc.

but they are different answers and i need to combine them to visualize this question, please advise what the best way/chart is to do it.

 

Many Thanks

6 REPLIES 6
Anonymous
Not applicable

i have sent a sample data where i want to display and visualize F2a (after merging the codes) and keep the sample size as it is 28 so the total should me more than 100% since it 's a multiple answer question duer to each respondent might give more than one answer

 

Many thanks

Noha

here's how you transpose/unpivot your data to make it usable. This will work for any number of columns.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("bdFBCoAgEIXhq4jrFs6MWp1FvP810lQw+heSfrxheFSKlxD84aUd937r0a2/bZpN03bXaTrNIBfBEuzIkDthxwWz92ZumAQwAdt7LDPIRbAEs3uPZSfYBbO9R/yaQg8VyCnk7L9DoYcmsAw71v8Y2Vof", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, F2a.Code1 = _t, F2a.Code2 = _t, F2a.Codes3 = _t]),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"ID"}, "Attribute", "Value"),
    #"Filtered Rows" = Table.SelectRows(#"Unpivoted Other Columns", each ([Value] <> " "))
in
    #"Filtered Rows"

How to use this code: Create a new Blank Query. Click on "Advanced Editor". Replace the code in the window with the code provided here. Click "Done".

Anonymous
Not applicable

Thank you Ibendin so much for your help and support,it is working fine for this specifc question but for others questions with the same concept it didn't work 

 

for example i have another question with the same structure : ID,column name (Q8_code_1,Q8_code_2,Q8_code_3,Q8_code_4) and the codes that was inserted not codes but text for example (lack of trainings,no clear career path,low salries,...) how can i edit the code to work on the similar concept taking into the consideration the sample size is different from question to another

 

one question is 780 another is 130 etc

 

many thanks again

Please provide sanitized sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.

lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Anonymous
Not applicable

IDF2a.Code1F2a.Code2F2a.Codes3
1001 1
1013 3
1022 2
1033 3
1043 3
1051 1
1063 3
1072 2
1081 1
1091  
1101  
1111  
1122  
1131  
1141  
1152  
1163  
1173  
1182  
1194  
1201  
1214  
1221  
1232  
1241  
1251  
1264  
12721 

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.