Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi , I need to transpose a dataset to get a specific value.
Here is my Input table
Below is my output table.
For each ticket in the input table I need to get the key values as columns and its corresponding values as values in the table. Please note that I cannot directly use a transpose as the dataset is very huge.
Please help me with the above request and let me know if any more info is required or need further explanation.
Solved! Go to Solution.
@Anonymous Can you just Pivot the Key column?
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQwVNJRcnQEEoZKsTpwAScgUZKRiizkDFJjZAwVMoJpMzJBFgHpS0xKRhaC6IOKGMNtQxEBaTMyNkEWAmlzdHFGFnIBEmUpSrGxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Tickets = _t, Key = _t, Value = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Tickets", Int64.Type}, {"Key", type text}, {"Value", type text}}),
#"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[Key]), "Key", "Value")
in
#"Pivoted Column"
@Greg_Deckler I forgot to check that dont aggregate option. Thanks it works now.
@Anonymous Can you just Pivot the Key column?
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQwVNJRcnQEEoZKsTpwAScgUZKRiizkDFJjZAwVMoJpMzJBFgHpS0xKRhaC6IOKGMNtQxEBaTMyNkEWAmlzdHFGFnIBEmUpSrGxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Tickets = _t, Key = _t, Value = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Tickets", Int64.Type}, {"Key", type text}, {"Value", type text}}),
#"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[Key]), "Key", "Value")
in
#"Pivoted Column"
@Greg_Deckler I have tried this but I'm not getting the desired output as my dataset is huge, I'm just getting 0 and 1 in my output. The method of pivoting key field would work for small use cases. What do I do
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
24 | |
12 | |
11 | |
11 | |
8 |
User | Count |
---|---|
43 | |
25 | |
15 | |
14 | |
12 |