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 usando debajo del concepto de Curbal para las categorías N principales, pero en categorías tengo subcategorías y bajo subcategorías, también tengo marcas. A nivel individual, todo funciona bien, pero cuando ensobro o expando categorías me muestra correcta para subcategorías, pero para Categorías me da todas las categorías.
Enlace de vídeo de Curbal : https://www.youtube.com/watch?v=SsZseKOgrWQ
Hola, @DeepDive
Según su descripción, creé datos para reproducir su escenario. El archivo pbix se adjunta al final.
Mesa:
Puede crear un parámetro hat-if como se muestra a continuación.
Aquí están las columnas y medidas calculadas:
Calculated column:
Level2 = [Category]&"-"&[Sub Category]
Level3 = [Category]&"-"&[Sub Category]&"-"&[Brand]
Measure:
Visual Control =
var _categorytopn =
SELECTCOLUMNS(
TOPN(
SELECTEDVALUE(Parameter[Parameter]),
SUMMARIZE(
ALL('Table'),
'Table'[Category],
"Sales",SUM('Table'[Sales])
),
[Sales]
),
"Category",
[Category]
)
var _subcategorytopn =
SELECTCOLUMNS(
TOPN(
SELECTEDVALUE(Parameter[Parameter]),
SUMMARIZE(
FILTER(
ALL('Table'),
'Table'[Category]=SELECTEDVALUE('Table'[Category])
),
'Table'[Category],
'Table'[Sub Category],
"Sales",SUM('Table'[Sales])
),
[Sales]
),
"Level2",
[Category]&"-"&[Sub Category]
)
var _brandtopn =
SELECTCOLUMNS(
TOPN(
SELECTEDVALUE(Parameter[Parameter]),
SUMMARIZE(
FILTER(
ALL('Table'),
'Table'[Category]=SELECTEDVALUE('Table'[Category])&&
'Table'[Sub Category]=SELECTEDVALUE('Table'[Sub Category])
),
'Table'[Category],
'Table'[Sub Category],
'Table'[Brand],
"Sales",SUM('Table'[Sales])
),
[Sales]
),
"Level3",
[Category]&"-"&[Sub Category]&"-"&[Brand]
)
return
IF(
ISINSCOPE('Table'[Category])&&NOT(ISINSCOPE('Table'[Sub Category]))&&NOT(ISINSCOPE('Table'[Brand])),
IF(
SELECTEDVALUE('Table'[Category]) in _categorytopn,
1,0
),
IF(
ISINSCOPE('Table'[Sub Category])&&NOT(ISINSCOPE('Table'[Brand])),
IF(
SELECTEDVALUE('Table'[Category]) in _categorytopn&&
SELECTEDVALUE('Table'[Level2]) in _subcategorytopn,
1,0
),
IF(
ISINSCOPE('Table'[Brand]),
IF(
SELECTEDVALUE('Table'[Category]) in _categorytopn&&
SELECTEDVALUE('Table'[Level2]) in _subcategorytopn&&
SELECTEDVALUE('Table'[Level3]) in _brandtopn,
1,0
)
)
)
)
Por último, puede colocar la medida en el filtro de nivel visual y utilizar el parámetro para filtrar el resultado de la parte superior. Dado que el número máximo de 'Marca' es 2, solo hay dos marcas en el nivel 'Marca', aunque la segmentación debanda se establezca como 3. Depende de sus datos.
Saludos
Allan
Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
@DeepDive , consulte si esto puede ayudar a
https://www.sqlbi.com/articles/filtering-the-top-3-products-for-each-category-in-power-bi/
Para rango Consulte estos enlaces
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/3...
Hola Amit, gracias por tu respuesta.
Mi requisito es mostrar YTD en todos los niveles solo para N superior seleccionado usando una sola rebanadora....
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 |