The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
From:
Employee ID | Questions | Response |
1299 | rate your current knowledge / skills levels | 1 |
23411 | rate your current knowledge / skills levels | 2 |
6718 | rate your current knowledge / skills levels | 4 |
23411 | Is this the first time you managing a team? | No |
3211 | rate your current knowledge / skills levels | 2 |
1299 | Is this the first time you managing a team? | Yes |
6718 | Is this the first time you managing a team? | No |
3211 | Is this the first time you managing a team? | Yes |
Result Table:
Employee ID | rate your current knowledge / skills levels | Is this the first time you managing a team? |
1299 | 1 | Yes |
23411 | 2 | No |
6718 | 4 | No |
3211 | 2 | Yes |
|
How to convert questions and response columns to result table(as shown in the picture) in Power BI?
Solved! Go to Solution.
Hi @Anonymous
Thanks for reaching out to us.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("pZC7DsIwDEV/xcpcCSWtgE7MLOxV1CECE6LmIcUuiL+nRAwwpiye7vG5ttZCqr4XjciGEZ5pznCec8bIMMX08HixCBugyXlP4PGOnpa0FGOjhWo7KatZVdjtTu6r0e5HeyTgm3sPhKvLxMAulG0QTDTWRQsGGE04LOlTKnCrVlf+fKpOOyB93/tP5xXi8QU=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Employee ID" = _t, Questions = _t, #" Response" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Employee ID", Int64.Type}, {"Questions", type text}, {" Response", type text}}),
#"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[Questions]), "Questions", " Response")
in
#"Pivoted Column"
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
Thanks for reaching out to us.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("pZC7DsIwDEV/xcpcCSWtgE7MLOxV1CECE6LmIcUuiL+nRAwwpiye7vG5ttZCqr4XjciGEZ5pznCec8bIMMX08HixCBugyXlP4PGOnpa0FGOjhWo7KatZVdjtTu6r0e5HeyTgm3sPhKvLxMAulG0QTDTWRQsGGE04LOlTKnCrVlf+fKpOOyB93/tP5xXi8QU=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Employee ID" = _t, Questions = _t, #" Response" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Employee ID", Int64.Type}, {"Questions", type text}, {" Response", type text}}),
#"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[Questions]), "Questions", " Response")
in
#"Pivoted Column"
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.