Forum Discussion
Power BI dashboard
- 3 years ago
Hi ATHULVADAKKATH ,
First for the Response table, unpivot these variable columns.
For the code book table, use the following code to transform.
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("vZE9C8IwEIb/ytHZSpMQ6KoudbEUx9IhmqsKpYE0Ffz3Jn61NDVuDuFy3BvueUhZRhAtJqdalFFBCLFN0WNnLqq1142SKDts8GhstzrhJzt+ncQkdcUbkDRm3FVvwnjME1upN+EElIa8kahd7g1GQ2CZuCLcVA8dIpgzgpASDlgrjWM5ugzqrbVoJRCYVdnCY0mGQkvI61mpV2anzDjnK7rAvp+yBQ2fbHT4qzDbV/4Jm+8wYqMDG/vNxv6MVt0B", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Variable = _t, Attribute = _t, Type = _t, #"Question/Answer" = _t, Code = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Variable", type text}, {"Attribute", type text}, {"Type", type text}, {"Question/Answer", type text}, {"Code", Int64.Type}}), #"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"Attribute", "Type"}), #"Replaced Value" = Table.ReplaceValue(#"Removed Columns"," ",null,Replacer.ReplaceValue,{"Variable"}), #"Filled Down" = Table.FillDown(#"Replaced Value",{"Variable"}), #"Filtered Rows" = Table.SelectRows(#"Filled Down", each ([Variable] <> null)) in #"Filtered Rows"
Then, merge the two tables.
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi ATHULVADAKKATH ,
First for the Response table, unpivot these variable columns.
For the code book table, use the following code to transform.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("vZE9C8IwEIb/ytHZSpMQ6KoudbEUx9IhmqsKpYE0Ffz3Jn61NDVuDuFy3BvueUhZRhAtJqdalFFBCLFN0WNnLqq1142SKDts8GhstzrhJzt+ncQkdcUbkDRm3FVvwnjME1upN+EElIa8kahd7g1GQ2CZuCLcVA8dIpgzgpASDlgrjWM5ugzqrbVoJRCYVdnCY0mGQkvI61mpV2anzDjnK7rAvp+yBQ2fbHT4qzDbV/4Jm+8wYqMDG/vNxv6MVt0B", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Variable = _t, Attribute = _t, Type = _t, #"Question/Answer" = _t, Code = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Variable", type text}, {"Attribute", type text}, {"Type", type text}, {"Question/Answer", type text}, {"Code", Int64.Type}}),
#"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"Attribute", "Type"}),
#"Replaced Value" = Table.ReplaceValue(#"Removed Columns"," ",null,Replacer.ReplaceValue,{"Variable"}),
#"Filled Down" = Table.FillDown(#"Replaced Value",{"Variable"}),
#"Filtered Rows" = Table.SelectRows(#"Filled Down", each ([Variable] <> null))
in
#"Filtered Rows"
Then, merge the two tables.
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.