Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
I have a table as follows
A | 5 |
6 | |
B | 7 |
5 | |
C | 3 |
5 | |
D | 6 |
7 |
and I want to transform it in Power Query editor as
A | 5 | 6 |
B | 7 | 5 |
C | 3 | 5 |
D | 6 | 7 |
How can I do that?
Solved! Go to Solution.
@dejudicibus Try this:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTJVitWJVlIAsszALCcgyxwuBpF1BrKM0cRc4DoUIDpiAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column = _t, Column1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column", type text}, {"Column1", Int64.Type}}),
#"Replaced Value" = Table.ReplaceValue(#"Changed Type","",null,Replacer.ReplaceValue,{"Column"}),
#"Replaced Value1" = Table.ReplaceValue(#"Replaced Value"," ",null,Replacer.ReplaceValue,{"Column"}),
#"Filled Down" = Table.FillDown(#"Replaced Value1",{"Column"}),
#"Added Index" = Table.AddIndexColumn(#"Filled Down", "Index", 1, 1, Int64.Type),
#"Added Custom" = Table.AddColumn(#"Added Index", "Custom", each Number.Mod([Index],2)),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Index"}),
#"Pivoted Column" = Table.Pivot(Table.TransformColumnTypes(#"Removed Columns", {{"Custom", type text}}, "en-US"), List.Distinct(Table.TransformColumnTypes(#"Removed Columns", {{"Custom", type text}}, "en-US")[Custom]), "Custom", "Column1", List.Sum),
#"Renamed Columns" = Table.RenameColumns(#"Pivoted Column",{{"1", "X"}, {"0", "Y"}})
in
#"Renamed Columns"
What is
i45WclTSUTJVitWJVlIAsszALCcgyxwuBpF1BrKM0cRc4DoUIDpiAQ==
@dejudicibus I used an Enter Data query to replicate your data. That's the Base 64 binary encoding of you table data.
@dejudicibus Try this:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTJVitWJVlIAsszALCcgyxwuBpF1BrKM0cRc4DoUIDpiAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column = _t, Column1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column", type text}, {"Column1", Int64.Type}}),
#"Replaced Value" = Table.ReplaceValue(#"Changed Type","",null,Replacer.ReplaceValue,{"Column"}),
#"Replaced Value1" = Table.ReplaceValue(#"Replaced Value"," ",null,Replacer.ReplaceValue,{"Column"}),
#"Filled Down" = Table.FillDown(#"Replaced Value1",{"Column"}),
#"Added Index" = Table.AddIndexColumn(#"Filled Down", "Index", 1, 1, Int64.Type),
#"Added Custom" = Table.AddColumn(#"Added Index", "Custom", each Number.Mod([Index],2)),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Index"}),
#"Pivoted Column" = Table.Pivot(Table.TransformColumnTypes(#"Removed Columns", {{"Custom", type text}}, "en-US"), List.Distinct(Table.TransformColumnTypes(#"Removed Columns", {{"Custom", type text}}, "en-US")[Custom]), "Custom", "Column1", List.Sum),
#"Renamed Columns" = Table.RenameColumns(#"Pivoted Column",{{"1", "X"}, {"0", "Y"}})
in
#"Renamed Columns"
User | Count |
---|---|
82 | |
80 | |
71 | |
70 | |
55 |
User | Count |
---|---|
108 | |
108 | |
97 | |
86 | |
68 |