Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hola equipo,
Tengo un requisito. Permítanme explicarles con ayuda de datos.
Datos de muestra :
|
Requisito:
Necesito encontrar la SUMA de valores para aquellos clientes que se han suscrito tanto para ANALYST como para SENIORS. Asimismo, también para clientes que se han suscrito tanto para JUNIORS COMO para SENIORS. Esta es la parte simple, pero el requisito principal es, si supongamos que algunos clientes se suscriben para ANALYST y SENIORS, entonces la SUMA sólo debe incluir los valores para SENIORS.
Por ejemplo:
En los datos de ejemplo anteriores, el cliente C se ha suscrito tanto a ANALYST como a SENIORS. Por lo tanto, el valor para esto debe ser 50000. Del mismo modo, el Cliente F se ha suscrito tanto a ANALYST como a SENIORS. Por lo tanto, el valor para esto debe ser 123330.
Salida necesaria cuando se selecciona SENIORS en la segmentación de datos.
Cliente | Valor de superposición |
C | 50000 |
F | 123330 |
Lo siento si no hubiera sido capaz de explicarlo claramente. Pero en caso de que se requiera cualquier información adicional por favor hágamelo saber.
Métodos que probé:
Creé una columna con la siguiente expresión
COLUMN ? CALCULATE(DISTINCTCOUNT('Sample'[ACCOUNTS]), INTERSECT( SELECTCOLUMNS(FILTER('Sample', 'Sample'[PRODUCTS] ? "ANALYST"), "CUSTOMER", 'Sample'[CUSTOMERS]), SELECTCOLUMNS(FILTER('Sample', 'Sample'[PRODUCTS] ? "SENIORS"), "CUSTOMER", 'Sample'[CUSTOMERS]) ) )
y luego creó una medida
Medida 2 - CALCULATE(sum('Sample'[VALUE]),'Sample'[COLUMN] á 1,'Sample'[PRODUCTS] á "SENIORS")Esto funcionó para la combinación ANALYST y SENIORS, pero si creo lo mismo para JUNIORS y SENIORS, entonces me da un error de dependencia circular.
Solved! Go to Solution.
Hola @Ani26,
¿Es esto lo que quieres lograr?
He hecho esto usando Power Query ya que no soy realmente bueno en Dax.
La mayoría de ellos no recomendarán crear otra tabla porque ralentiza el informe.
Si está abierto con esta idea, puede hacer referencia a tablas y probar estos pasos:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("bY9LDoMwDAXv4jWqgt0QWEYFJCilqGkXVZT7X6M2PyHTVfTGL2M5RvCQwdVVWF6cdZXl5Ec/fMMbUhbhxpnKwhijBjXnHO2JN5w1a6VL9iy5zxJClEFoxu75Cvta6Ws+rPYje0i3ULBdzES6PclBf8x+/oBI/PYfJcqX/pFP29Ydph8=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [CUSTOMERS = _t, VALUE = _t, PRODUCTS = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"CUSTOMERS", type text}, {"VALUE", type number}, {"PRODUCTS", type text}}),
#"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[PRODUCTS]), "PRODUCTS", "VALUE", List.Sum),
#"Added Custom" = Table.AddColumn(#"Pivoted Column", "Analyst and Seniors (Seniors Value)", each if [ANALYST] <> null
and [SENIORS] <> null
then [SENIORS]
else null),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "Seniors and Juniors (Seniors Value)", each if [SENIORS] <> null
and [JUNIORS] <> null
then [SENIORS]
else null),
#"Changed Type1" = Table.TransformColumnTypes(#"Added Custom1",{{"Analyst and Seniors (Seniors Value)", Int64.Type}, {"Seniors and Juniors (Seniors Value)", Int64.Type}})
in
#"Changed Type1"
a continuación, puede realizar una relación mediante la columna de cliente.
Espero que esto ayude
Hola @Ani26,
¿Es esto lo que quieres lograr?
He hecho esto usando Power Query ya que no soy realmente bueno en Dax.
La mayoría de ellos no recomendarán crear otra tabla porque ralentiza el informe.
Si está abierto con esta idea, puede hacer referencia a tablas y probar estos pasos:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("bY9LDoMwDAXv4jWqgt0QWEYFJCilqGkXVZT7X6M2PyHTVfTGL2M5RvCQwdVVWF6cdZXl5Ec/fMMbUhbhxpnKwhijBjXnHO2JN5w1a6VL9iy5zxJClEFoxu75Cvta6Ws+rPYje0i3ULBdzES6PclBf8x+/oBI/PYfJcqX/pFP29Ydph8=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [CUSTOMERS = _t, VALUE = _t, PRODUCTS = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"CUSTOMERS", type text}, {"VALUE", type number}, {"PRODUCTS", type text}}),
#"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[PRODUCTS]), "PRODUCTS", "VALUE", List.Sum),
#"Added Custom" = Table.AddColumn(#"Pivoted Column", "Analyst and Seniors (Seniors Value)", each if [ANALYST] <> null
and [SENIORS] <> null
then [SENIORS]
else null),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "Seniors and Juniors (Seniors Value)", each if [SENIORS] <> null
and [JUNIORS] <> null
then [SENIORS]
else null),
#"Changed Type1" = Table.TransformColumnTypes(#"Added Custom1",{{"Analyst and Seniors (Seniors Value)", Int64.Type}, {"Seniors and Juniors (Seniors Value)", Int64.Type}})
in
#"Changed Type1"
a continuación, puede realizar una relación mediante la columna de cliente.
Espero que esto ayude