Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi all,
This is what I have at the moment:
This is what I want:
name | des |
a | H12345 |
a | H45678 |
b | H44444 |
c | H55555 |
c | H66666 |
c | H77777 |
d | H88888 |
How would I go about doing this in the Power BI?
Appreciate any of your suggestions!
Best,
JPY
Solved! Go to Solution.
Here's how I would do it - unpivot all columns except name then tidy up (important steps in red):
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSlTSUfIwNDI2MQUxTEzNzC2ADKVYnWilJLAICIBEoILJIEFTEAAxzEAAxDAHAbCCFBDXAgRgumIB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [name = _t, des = _t, #"1" = _t, #"2" = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"name", type text}, {"des", type text}, {"1", type text}, {"2", type text}}), UnpivotAllExceptName = Table.UnpivotOtherColumns(#"Changed Type", {"name"}, "Attribute", "Value"), RenameToDes = Table.RenameColumns(UnpivotAllExceptName,{{"Value", "des"}}), RemoveAttribute = Table.RemoveColumns(RenameToDes,{"Attribute"}), RemoveBlankDes = Table.SelectRows(RemoveAttribute, each ([des] <> "" and [des] <> null)) in RemoveBlankDes
Regards,
Owen
Here's how I would do it - unpivot all columns except name then tidy up (important steps in red):
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSlTSUfIwNDI2MQUxTEzNzC2ADKVYnWilJLAICIBEoILJIEFTEAAxzEAAxDAHAbCCFBDXAgRgumIB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [name = _t, des = _t, #"1" = _t, #"2" = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"name", type text}, {"des", type text}, {"1", type text}, {"2", type text}}), UnpivotAllExceptName = Table.UnpivotOtherColumns(#"Changed Type", {"name"}, "Attribute", "Value"), RenameToDes = Table.RenameColumns(UnpivotAllExceptName,{{"Value", "des"}}), RemoveAttribute = Table.RemoveColumns(RenameToDes,{"Attribute"}), RemoveBlankDes = Table.SelectRows(RemoveAttribute, each ([des] <> "" and [des] <> null)) in RemoveBlankDes
Regards,
Owen
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
95 | |
77 | |
65 | |
53 |
User | Count |
---|---|
144 | |
105 | |
102 | |
89 | |
63 |