Hola
Tengo una mesa como esta:
Id | Pronóstico1 | Pronóstico2 | Pronóstico3 | Actual1 | Actual2 | Actual3 |
1 | A | B | C | D | E | F |
2 | G | H | J | K | L | M |
Y quiero hacerlo como abajo en Power Query Editor. ¿Hay alguna manera de hacer esto sin tener varias tablas duplicadas y anexarlas de nuevo. ¡Gracias por la ayuda!
Id | Pronóstico | Actual | End Num |
1 | A | D | 1 |
1 | B | E | 2 |
1 | C | F | 3 |
2 | G | K | 1 |
2 | H | L | 2 |
2 | J | M | 3 |
Solved! Go to Solution.
Hola @Shukurovasif ,
prueba esto. PBIX
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("DcY5DQAgEEVBL7+mAQfchEPBZv3b4BWTjJmigjIKKho6hjyYEptY2Di4eHL/", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [ID = _t, Forecast1 = _t, Forecast2 = _t, Forecast3 = _t, Actual1 = _t, Actual2 = _t, Actual3 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"Forecast1", type text}, {"Forecast2", type text}, {"Forecast3", type text}, {"Actual1", type text}, {"Actual2", type text}, {"Actual3", type text}}),
#"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"ID"}, "Attribute", "Value"),
#"Split Column by Character Transition" = Table.SplitColumn(#"Unpivoted Columns", "Attribute", Splitter.SplitTextByCharacterTransition((c) => not List.Contains({"0".."9"}, c), {"0".."9"}), {"Attribute.1", "Attribute.2"}),
#"Pivoted Column" = Table.Pivot(#"Split Column by Character Transition", List.Distinct(#"Split Column by Character Transition"[Attribute.1]), "Attribute.1", "Value"),
#"Renamed Columns" = Table.RenameColumns(#"Pivoted Column",{{"Attribute.2", "End Num"}})
in
#"Renamed Columns"
Marcus Wegener work at KUMAVISION AG , one of the world's largest
implementation partners for Microsoft Dynamics. #
"Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast
Hola @Shukurovasif ,
prueba esto. PBIX
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("DcY5DQAgEEVBL7+mAQfchEPBZv3b4BWTjJmigjIKKho6hjyYEptY2Di4eHL/", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [ID = _t, Forecast1 = _t, Forecast2 = _t, Forecast3 = _t, Actual1 = _t, Actual2 = _t, Actual3 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"Forecast1", type text}, {"Forecast2", type text}, {"Forecast3", type text}, {"Actual1", type text}, {"Actual2", type text}, {"Actual3", type text}}),
#"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"ID"}, "Attribute", "Value"),
#"Split Column by Character Transition" = Table.SplitColumn(#"Unpivoted Columns", "Attribute", Splitter.SplitTextByCharacterTransition((c) => not List.Contains({"0".."9"}, c), {"0".."9"}), {"Attribute.1", "Attribute.2"}),
#"Pivoted Column" = Table.Pivot(#"Split Column by Character Transition", List.Distinct(#"Split Column by Character Transition"[Attribute.1]), "Attribute.1", "Value"),
#"Renamed Columns" = Table.RenameColumns(#"Pivoted Column",{{"Attribute.2", "End Num"}})
in
#"Renamed Columns"
Marcus Wegener work at KUMAVISION AG , one of the world's largest
implementation partners for Microsoft Dynamics. #
"Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast
¿Puede decirnos cuál es el objetivo?
Esto parece uno de esos casos en los que tiene más sentido manipular los datos antes de cargarlos en Power BI.
La columna de "números finales" significa que va a hacer 3 pasadas sobre los datos base, y realizar un seguimiento del "número" de la pasada.
Hay funciones de código M que le permiten crear nuevas filas.... pero sería más fácil averiguarlo si supiéramos lo que intentas lograr.
Help when you know. Ask when you don't!
Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.
Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!
Join the biggest FREE Business Applications Event in LATAM this February.
User | Count |
---|---|
3 | |
1 | |
1 | |
1 | |
1 |