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.
¿Cómo puedo lograr el tipo de vista inferior en power bi matrix visual?
Gracias de antemano
Cree la nueva tabla.
Columns =
UNION (
CROSSJOIN ( { "By Product" }, VALUES ( 'Table'[Product] ) ),
CROSSJOIN ( { "By Year" }, VALUES ( 'Table'[Year] ) ),
CROSSJOIN (
{ "Summarizations" },
SELECTCOLUMNS (
{ "Total", "% of Total Sales", "Avg Sale Size" },
"value2", [Value]
)
)
)
A continuación, cree la medida.
MatrixValue =
VAR ByProduct =
CALCULATE (
SUM ( 'Table'[Sales] ),
FILTER ( 'Table', 'Table'[Product] = MAX ( 'Columns'[Sub_header] ) )
)
VAR ByYear =
CALCULATE (
SUM ( 'Table'[Sales] ),
FILTER (
'Table',
FORMAT ( 'Table'[Year], 0000 ) = MAX ( 'Columns'[Sub_header] )
)
)
VAR total = SUM ( 'Table'[Sales] )
VAR totalPercent = total / SUMX ( ALL ( 'Table' ), 'Table'[Sales] )
VAR Avg_ = AVERAGE ( 'Table'[Sales] )
RETURN
SWITCH (
MAX ( 'Columns'[Header] ),
"By Product", ByProduct,
"By Year", ByYear,
SWITCH (
MAX ( 'Columns'[Sub_header] ),
"Total", total,
"% of Total Sales", FORMAT ( totalPercent, "Percent" ),
"Avg Sale Size", FORMAT ( Avg_, ".0" )
)
)
Si el problema aún no se resuelve, proporcione información detallada sobre el error o el resultado esperado que espera. Hágamelo saber de inmediato, esperando su respuesta.
Saludos
Winniz
Si esta publicación ayuda, considere Aceptarla como la solución para ayudar a los otros miembros a encontrarla más rápidamente.
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 |