Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
I have data in below format:
Date | Asset ID | Value |
1/1/2022 | 1 | 50 |
1/2/2022 | 2 | 55 |
1/3/2022 | 3 | 60 |
1/4/2022 | 4 | 65 |
I would like to transform this table below:
A common date column, but each asset having its own column. Any tips? Either as a calculated table or via Power Query.
Date | Asset 1 | Asset 2 | Asset 3 | Asset 4 | Value |
Solved! Go to Solution.
Hi @numersoz
Is this an output you are looking for?
if yes, in Power Query select Asset and Value and use pivot column.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WckksSVXSUXIsLk4tUfB0ATLDEnNKU5VidaKVDPUN9Y0MjIyAgoZAbGoAFTWCiYKwqSlU1BgmagzEZjC1JjBRE5AoUG0sAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"(blank)" = _t, #"(blank).1" = _t, #"(blank).2" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"(blank)", type text}, {"(blank).1", type text}, {"(blank).2", type text}}),
#"Promoted Headers" = Table.PromoteHeaders(#"Changed Type", [PromoteAllScalars=true]),
#"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"Date", type date}, {"Asset ID", Int64.Type}, {"Value", Int64.Type}}),
#"Pivoted Column" = Table.Pivot(Table.TransformColumnTypes(#"Changed Type1", {{"Asset ID", type text}}, "en-AU"), List.Distinct(Table.TransformColumnTypes(#"Changed Type1", {{"Asset ID", type text}}, "en-AU")[#"Asset ID"]), "Asset ID", "Value"),
#"Renamed Columns" = Table.RenameColumns(#"Pivoted Column",{{"1", "Asset 1"}, {"2", "Asset 2"}, {"3", "Asset 3"}, {"4", "Asset 4"}})
in
#"Renamed Columns"
IF no, please share an expected result
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
Hi @numersoz
Is this an output you are looking for?
if yes, in Power Query select Asset and Value and use pivot column.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WckksSVXSUXIsLk4tUfB0ATLDEnNKU5VidaKVDPUN9Y0MjIyAgoZAbGoAFTWCiYKwqSlU1BgmagzEZjC1JjBRE5AoUG0sAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"(blank)" = _t, #"(blank).1" = _t, #"(blank).2" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"(blank)", type text}, {"(blank).1", type text}, {"(blank).2", type text}}),
#"Promoted Headers" = Table.PromoteHeaders(#"Changed Type", [PromoteAllScalars=true]),
#"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"Date", type date}, {"Asset ID", Int64.Type}, {"Value", Int64.Type}}),
#"Pivoted Column" = Table.Pivot(Table.TransformColumnTypes(#"Changed Type1", {{"Asset ID", type text}}, "en-AU"), List.Distinct(Table.TransformColumnTypes(#"Changed Type1", {{"Asset ID", type text}}, "en-AU")[#"Asset ID"]), "Asset ID", "Value"),
#"Renamed Columns" = Table.RenameColumns(#"Pivoted Column",{{"1", "Asset 1"}, {"2", "Asset 2"}, {"3", "Asset 3"}, {"4", "Asset 4"}})
in
#"Renamed Columns"
IF no, please share an expected result
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
17 | |
10 | |
10 | |
8 | |
6 |
User | Count |
---|---|
18 | |
16 | |
15 | |
12 | |
10 |