Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hice esta pregunta antes, pero no lo expliqué correctamente.
así que tengo una tabla ( "TABLE 1") que tiene 4 columnas, quería crear un kpi usando Línea y gráfico de columnas agrupadas.
el cuadro contiene el objetivo de diferentes SBU para diferentes meses del año 2020.
He creado otra tabla con los mismos nombres de columna, pero el SBU está vacío junto con el destino. (TABLA 2)
Por lo tanto, en mi línea y gráfico de columnas agrupadas cuando no se selecciona ningún SBU debe mostrar los valores de la Tabla 2 y cuando se selecciona SBU debe mostrar el valor máximo de ese SBU en particular durante todos los meses.
pero no sé cómo crear una medida para este problema en particular. En el punto de vista anterior cuando no se selecciona SBU se supone que muestra 94.40 % para el mes de enero de TABLE 2 , en lugar de que está mostrando 94.20% porque está tomando el promedio de todo SBU para el mes enero de TABLE 1
Hola @9192gks ,
Lo siento me temo que no he cogido su punto, ¿podría pls mostrarme su archivo .pbix, y aconsejarme su salida esperada?
Elimine los datos si son confidenciales.
Allí, @9192gks
En función de su descripción, he creado datos para reproducir su escenario.
pestaña:
mesa:
Puede crear dos medidas como se indica a continuación.
Target measure =
var _month = SELECTEDVALUE('Table'[Month].[Month])
var _sbu = SELECTEDVALUE(Tab[SBU])
return
IF(
NOT(ISFILTERED(Tab[SBU])),
CALCULATE(
SUM('Table'[Target]),
FILTER(
ALLSELECTED('Table'),
'Table'[Month].[Month] = _month
)
),
IF(
HASONEVALUE(Tab[SBU]),
CALCULATE(
MAX(Tab[Target]),
FILTER(
ALLSELECTED(Tab),
Tab[SBU] = _sbu&&
Tab[Month].[Month] = _month
)
)
)
)
KP measure =
var _month = SELECTEDVALUE('Table'[Month].[Month])
var _sbu = SELECTEDVALUE(Tab[SBU])
return
IF(
NOT(ISFILTERED(Tab[SBU])),
CALCULATE(
SUM('Table'[KP]),
FILTER(
ALLSELECTED('Table'),
'Table'[Month].[Month] = _month
)
),
IF(
HASONEVALUE(Tab[SBU]),
CALCULATE(
MAX(Tab[KP]),
FILTER(
ALLSELECTED(Tab),
Tab[SBU] = _sbu&&
Tab[Month].[Month] = _month
)
)
)
)
resultado:
Saludos
Allan
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.
@9192gks , que ha utilizado se filtra o tiene un valor
https://powerpivotpro.com/2013/03/hasonevalue-vs-isfiltered-vs-hasonefilter/
O
https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.