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, estoy buscando un Dax para resumir los totales resaltados en la imagen de matriz adjunta (por región AN).
1 El valor es el resultado del siguiente DAX (ejemplo de una región):
La segunda parte de IsInscope es la que necesito arreglar (var CatinAn) para reflejar el valor total correcto. '2' en este caso.
Estos son los scripts para volver a crear las tablas del ejemplo:
dim_customers
dejar
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQwMFDSUXJOLElNzy+qVHBUitUBixoiizrBRI2QRZ1hosbIoi4wURNkUVel2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Customer_ID = _t, Category = _t]),
#"Tipo cambiado" = Table.TransformColumnTypes(Source,{{"Customer_ID", Int64.Type}, {"Category", escriba text}})
en
#"Tipo cambiado"
ft_sales
dejar
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("bc6xDcAwCATAXahdPBgnziyW918jQSjhixTI6PSA1xKVlgXgeUwhuyWP5Gg7iintxEZLiI9aYqP4TI6hz2Zaj3uzohex4S+tlPZkf7+xbw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ProductID = _t, CountryId = _t, Customer_ID = _t, Sales = _t]),
#"Tipo cambiado" = Table.TransformColumnTypes(Source,{{"CountryId", Int64.Type}, {"Customer_ID", Int64.Type}, {"Sales", Int64.Type}})
en
#"Tipo cambiado"
dim_country
dejar
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUXLOyMxJBdLB/s7+SrE60UpGQI5jUXpqXklmXiKyhDGQE1pUml6aWIksbALk+KZWZCbngxgRYDFTIDMgsSgRqtbRDyxqBmQ65edklmUmIgTNgUzX5NLElPwihKAFyGH5Ofm5SchKLUGmphaVQkViAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Country ID" = _t, Country = _t, Region = _t]),
#"Tipo cambiado" = Table.TransformColumnTypes(Source,{{"Country ID", Int64.Type}, {"Country", type text}, {"Region", type text}})
en
#"Tipo cambiado"
dim_product
dejar
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUXIEYUel2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ProductID = _t, Division = _t, BusinessUnit = _t]),
#"Tipo cambiado" = Table.TransformColumnTypes(Source,{{"ProductID", Int64.Type}, {"Division", type text}, {"BusinessUnit", type text}})
en
#"Tipo cambiado"
Modelo de datos
Realmente aprecio cualquier ayuda. saludos.
Solved! Go to Solution.
Hay @arlequin71 ,
Esta función se utiliza para modificar Total.
Ctgry in AN_Hasonevalue =
var _table=SUMMARIZE('dim_customers',[Category],"1",[Ctgry in AN])
return
IF(HASONEVALUE(dim_customers[Category]),[Ctgry in AN],SUMX(_table,[1]))
Cree una tabla virtual por SUMMARIZE y juzgue por HASONEVALUE. Si hay un valor, mostrará [Ctgry en AN], y si no hay ningún valor, mostrará el Total correcto.
Por ejemplo, debería mostrar Total como 4 aquí, pero la pantalla es todo 1:
Después de usar la función, Total mostrará el valor correcto:
Total incorrecto es un problema común, este artículo explica por qué y cómo resolverlo:
https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376
Saludos
Liu Yang
Si este post ayuda,entonces por favor considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
Hay @arlequin71 ,
Esta función se utiliza para modificar Total.
Ctgry in AN_Hasonevalue =
var _table=SUMMARIZE('dim_customers',[Category],"1",[Ctgry in AN])
return
IF(HASONEVALUE(dim_customers[Category]),[Ctgry in AN],SUMX(_table,[1]))
Cree una tabla virtual por SUMMARIZE y juzgue por HASONEVALUE. Si hay un valor, mostrará [Ctgry en AN], y si no hay ningún valor, mostrará el Total correcto.
Por ejemplo, debería mostrar Total como 4 aquí, pero la pantalla es todo 1:
Después de usar la función, Total mostrará el valor correcto:
Total incorrecto es un problema común, este artículo explica por qué y cómo resolverlo:
https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376
Saludos
Liu Yang
Si este post ayuda,entonces por favor considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
Hay @arlequin71 ,
Puede utilizar hasonevaluation para visualizar el valor en total.
Estos son los pasos que puede seguir:
1. Crear medida.
Ctgry in AN_Hasonevalue =
var _table=SUMMARIZE('dim_customers',[Category],"1",[Ctgry in AN])
return
IF(HASONEVALUE(dim_customers[Category]),[Ctgry in AN],SUMX(_table,[1]))
2. Resultado:
Saludos
Liu Yang
Si este post ayuda,entonces por favor considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
Hola Liu, gracias por su respuesta, su enfoque está más cerca de la solución que necesito, pero lo que necesita específicamente es corregir la primera columna Total. En mi ejemplo está mostrando 4 en lugar de 2 que es el resultado correcto.
Gracias por su ayuda.
Este parece ser el enfoque correcto
(1) Dax para Power BI: corrección de totales de medida incorrectos - YouTube
pero cuando intento aplicar la fórmula recibo el mensaje:
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 |