Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Sign up nowGet Fabric certified for FREE! Don't miss your chance! Learn more
Hello,
I have a table like this:
although it has more 8 columns.
could you please tell me how can I Pivot the whole table, in such a way that for each day I get one row, not multiple rows.
Solved! Go to Solution.
@Anonymous , Please check this power query code. Unpivot value column. Merge column - Meal + attribure
Pivot again
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMtY31DcyMDJS0lHyKc1LzgDShgYgQilWB0XWqSg1MTstsbgEJGkIIvSM0NWkZOblpRYBGRZAbAyVNcJrvhER5hvhMj8WAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, Meal = _t, Cal = _t, Fat = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Meal", type text}, {"Cal", Int64.Type}, {"Fat", type number}}),
#"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Date", "Meal"}, "Attribute", "Value"),
#"Merged Columns" = Table.CombineColumns(#"Unpivoted Columns",{"Meal", "Attribute"},Combiner.CombineTextByDelimiter(" ", QuoteStyle.None),"Merged"),
#"Pivoted Column" = Table.Pivot(#"Merged Columns", List.Distinct(#"Merged Columns"[Merged]), "Merged", "Value", List.Sum)
in
#"Pivoted Column"
Add to a blank query and check
@Anonymous , Please check this power query code. Unpivot value column. Merge column - Meal + attribure
Pivot again
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMtY31DcyMDJS0lHyKc1LzgDShgYgQilWB0XWqSg1MTstsbgEJGkIIvSM0NWkZOblpRYBGRZAbAyVNcJrvhER5hvhMj8WAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, Meal = _t, Cal = _t, Fat = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Meal", type text}, {"Cal", Int64.Type}, {"Fat", type number}}),
#"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Date", "Meal"}, "Attribute", "Value"),
#"Merged Columns" = Table.CombineColumns(#"Unpivoted Columns",{"Meal", "Attribute"},Combiner.CombineTextByDelimiter(" ", QuoteStyle.None),"Merged"),
#"Pivoted Column" = Table.Pivot(#"Merged Columns", List.Distinct(#"Merged Columns"[Merged]), "Merged", "Value", List.Sum)
in
#"Pivoted Column"
Add to a blank query and check
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 62 | |
| 62 | |
| 42 | |
| 21 | |
| 18 |