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.
Hola
Tengo una tabla como esta:
aunque tiene más de 8 columnas.
¿Podría decirme cómo puedo pivotar toda la tabla, de tal manera que por cada día obtenga una fila, no varias filas?
Solved! Go to Solution.
@eshragh_g , Compruebe este código de consulta de energía. Columna de valor Unpivot. Columna de fusión - Comida + atribución
Pivote de nuevo
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"
Agregar a una consulta en blanco y marcar
@eshragh_g , Compruebe este código de consulta de energía. Columna de valor Unpivot. Columna de fusión - Comida + atribución
Pivote de nuevo
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"
Agregar a una consulta en blanco y marcar
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 |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |
User | Count |
---|---|
2 | |
2 | |
2 | |
2 | |
1 |