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 a todos
Estoy buscando convertir el siguiente código en consulta de energía con el fin de despivor mi tabla
Clasificación TOTAL ?
CALCULAR (
SUM ( envíos[Valor] ),
ALLEXCEPT ( envíos, presentaciones[Clasificación], envíos[NombreDeEmem- ) ),
NOT ( ISBLANK ( envíos[Valor] ) )
)
/ CALCULATE (
COUNTA ( envíos[Valor] ),
ALLEXCEPT ( envíos, presentaciones[Clasificación], envíos[NombreDeEmem- ) ),
NOT ( ISBLANK ( envíos[Valor] ) )
Para obtener la siguiente tabla:
El DAX anterior se utiliza para sumar todos los valores para todas las manzanas E y S e introducir esto como un total. esto se divide por el recuento de valores para manzana.
Gracias de antemano por su ayuda
Solved! Go to Solution.
Hola @NNaj ,
Puede utilizar la función Table.Group para lograrlo en Power Query Editor:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclXSUXIsKMhJBdKGBkqxOhChkNTinESQkClcCKbKFFOVCUQoGEmVEaaQIUIIphFoeiwA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Classification = _t, Company = _t, Value = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Classification", type text}, {"Company", type text}, {"Value", Int64.Type}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"Classification", "Company"}, {{"Column", each List.Sum([Value]), type nullable number}, {"Rows", each _, type table [Classification=nullable text, Company=nullable text, Value=nullable number]}}),
#"Expanded Rows" = Table.ExpandTableColumn(#"Grouped Rows", "Rows", {"Value"}, {"Value"}),
#"Reordered Columns" = Table.ReorderColumns(#"Expanded Rows",{"Classification", "Company", "Value", "Column"})
in
#"Reordered Columns"
También puede consultar la siguiente documentación para lograrlo.
Agrupación de filas con Power BI / Power Query
Saludos
Rena
Hola @NNaj ,
Puede utilizar la función Table.Group para lograrlo en Power Query Editor:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclXSUXIsKMhJBdKGBkqxOhChkNTinESQkClcCKbKFFOVCUQoGEmVEaaQIUIIphFoeiwA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Classification = _t, Company = _t, Value = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Classification", type text}, {"Company", type text}, {"Value", Int64.Type}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"Classification", "Company"}, {{"Column", each List.Sum([Value]), type nullable number}, {"Rows", each _, type table [Classification=nullable text, Company=nullable text, Value=nullable number]}}),
#"Expanded Rows" = Table.ExpandTableColumn(#"Grouped Rows", "Rows", {"Value"}, {"Value"}),
#"Reordered Columns" = Table.ReorderColumns(#"Expanded Rows",{"Classification", "Company", "Value", "Column"})
in
#"Reordered Columns"
También puede consultar la siguiente documentación para lograrlo.
Agrupación de filas con Power BI / Power Query
Saludos
Rena
No creo que nadie quiera realizar ingeniería inversa de ese código y convertirlo en consulta de potencia.
¿Por qué no publicas una muestra de datos (no una imagen) de antes y después y nos dices las condiciones especiales requeridas?
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 | |
2 | |
2 | |
2 | |
1 |