Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Tengo datos mes base , si selecciono septiembre necesito suma de enero a septiembre
He creado la tabla de calender, he probado muchas medidas pero no puedo obtener el valor correcto,
datos de muestra
Solved! Go to Solution.
Hola, @RajeshRanganath
Según su descripción, creé datos para reproducir su escenario. El archivo pbix se adjunta al final.
Mesa:
Puede crear una columna calculada como se muestra a continuación.
Month Year = YEAR([Date])*100+MONTH([Date])
MY (una tabla calculada):
MY = DISTINCT('Table'[Month Year])
No hay ninguna relación entre dos tablas. Puede crear una medida como se indica a continuación.
Result =
IF(
HASONEVALUE(MY[Month Year]),
CALCULATE(
SUM('Table'[ACT YTD]),
FILTER(
ALL('Table'),
'Table'[KPI]=SELECTEDVALUE('Table'[KPI])&&
'Table'[Month Year]<=SELECTEDVALUE(MY[Month Year])&&
YEAR('Table'[Date])=INT(DIVIDE(SELECTEDVALUE(MY[Month Year]),100))
)
)
)
Resultado:
Best Regard
Allan
Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
Hola
Esta medida debería funcionar
•calculate([act ytd],datesytd(calendar[date],"31/12"))
A su vsisual, arrastre Año y Mes desde la tabla Calendario. Seleccione cualquier año/mes.
Hola, @RajeshRanganath
Según su descripción, creé datos para reproducir su escenario. El archivo pbix se adjunta al final.
Mesa:
Puede crear una columna calculada como se muestra a continuación.
Month Year = YEAR([Date])*100+MONTH([Date])
MY (una tabla calculada):
MY = DISTINCT('Table'[Month Year])
No hay ninguna relación entre dos tablas. Puede crear una medida como se indica a continuación.
Result =
IF(
HASONEVALUE(MY[Month Year]),
CALCULATE(
SUM('Table'[ACT YTD]),
FILTER(
ALL('Table'),
'Table'[KPI]=SELECTEDVALUE('Table'[KPI])&&
'Table'[Month Year]<=SELECTEDVALUE(MY[Month Year])&&
YEAR('Table'[Date])=INT(DIVIDE(SELECTEDVALUE(MY[Month Year]),100))
)
)
)
Resultado:
Best Regard
Allan
Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
@RajeshRanganath ¿Qué tal TOTALYTD func?
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
He intentado
Me pregunto por qué usa ALL('table') como el 3er parámetro en la fórmula; entonces su fórmula corresponde a
CALCULATE (
SUM('table'[ACT YTD]),
DATESYTD ( 'table'[Month year] ),
ALL ( 'table' )
)
ALL('table') elimina todos los filtros en 'tabla', lo que da como resultado un cálculo incorrecto.
Por cierto, puede utilizar una medida de este tipo para mostrar las fechas utilizadas en el cálculo después de una selección de mes.
Debug =
MINX ( DATESYTD ( 'table'[Date] ), 'table'[Date] ) & " to "
& MAXX ( DATESYTD ( 'table'[Date] ), 'table'[Date] )
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |