Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hola amigos,
Necesito ayuda para crear totales para cada fila en una matriz como se muestra a continuación, para cada mes tengo que calcular los totales de los elementos individuales y mostrarlos en la parte inferior de la matriz. Por favor, sugiera. Gracias de antemano.
Hola, @Fabric999
Gracias por la respuesta de @Rupak_bi. Puede probar el siguiente método para lograr su necesidad.
Paso 1: Agregue totales a la tabla original para los valores de ventas correspondientes a cada fecha
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("fZS9TgMxEITf5epI8f/ZJYQmikSDqE4pEKJAUEHF23N2zs6td8dNTroZ7c14P2dZJn007miU8dNhOr39/K6P15eH9dfM0/WwTAbp2hTdQj0W3SE93eZ7pMfb/IB0m4q+z//4+fWxC2BZAWpYX/UNOoNlFajBKtaBGubASnQheYvT3/v3PkTge6COFPgmqCPyIp1DK16lD6L4QqgjOF5mW9nlnkIiKssBA5VlryFPRQ4Qpyw7D2nKsubJ255KNr4Eoke+AqJrj0kqOk9PdDPgKOvWDjAqA9KAonJAwukTw3ZfZYZKBjcg6HK/kDJAu5YCP+fnp3MmzGmEUHXEiCiqDmMQSNWRPGKpfQXi1GbMkKhq8QpC1SWRuGpTHESrWmyEdFVLiBCw7mRFxtp+eCXmmYUN9Z7tvomwVc/wL6sLLTLXAq1zrv8=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, Product = _t, Country = _t, Sales = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Product", type text}, {"Country", type text}, {"Sales", Int64.Type}}),
#"GroupedRows" = Table.Group(#"Changed Type", {"Date", "Product"}, {{"Total Sales", each List.Sum([Sales]), type number}}),
NewRows1 = Table.TransformColumns(GroupedRows, {{"Total Sales", each _}}),
NewRows2 = Table.AddColumn(NewRows1, "Country", each "Totals of each month"),
CombinedTable = Table.Combine({Source, NewRows2}),
#"Changed Type1" = Table.TransformColumnTypes(CombinedTable,{{"Date", type date}, {"Sales", Int64.Type}, {"Total Sales", Int64.Type}}),
#"Replaced Value" = Table.ReplaceValue(#"Changed Type1",null,0,Replacer.ReplaceValue,{"Sales"}),
#"Replaced Value1" = Table.ReplaceValue(#"Replaced Value",null,0,Replacer.ReplaceValue,{"Total Sales"}),
#"Added Custom" = Table.AddColumn(#"Replaced Value1", "Custom", each [Sales]+[Total Sales]),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Sales", "Total Sales"}),
#"Renamed Columns" = Table.RenameColumns(#"Removed Columns",{{"Custom", "Sales"}})
in
#"Renamed Columns"
Paso 2: Agregue la nueva tabla de país y ordene por índice
Saludos
Yang
Equipo de apoyo a la comunidad
Si hay alguna publicación Ayuda, entonces por favor considere Acéptalo como la solución Para Ayude a los otros miembros a encontrarlo más rápidamente.
Si no entiendo sus necesidades o aún tiene problemas con él, no dude en hacérnoslo saber. ¡Muchas gracias!
Cómo obtener respuestas rápidas a sus preguntas -- Proporcionar datos de ejemplo en el foro de Power BI
Para obtener los totales a continuación, debe crear otra tabla de matriz sin país en la fila.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.