Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hola Comunidad..!!
Por favor, consulte la foto de arriba,
Estoy calculando YTD aquí,
1. Quiero mostrar el resultado de febrero a marzo y el resultado de marzo a abril y así sucesivamente.
2. Quiero mostrar el resultado de febrero a abril y el resultado de marzo a mayo y así sucesivamente.
He utilizado la siguiente lógica para calcular el mes actual hasta la fecha.
Solved! Go to Solution.
Gracias @rajendraongole1
Es correcto,
solo un ligero cambio en el cálculo según mi requisito,
Hola @PatilPrasad027 ,
Puede usar OFFSET para obtener el YTD antes de la fila actual o antes de eso, pero la fórmula exacta variará según la dimensión en el objeto visual.
YTD sum =
CALCULATE ( [Sales], DATESYTD ( d_Dates[Date] ) )
YTD LM =
CALCULATE (
[YTD sum],
OFFSET (
-1,
ALLSELECTED ( d_Dates[Year], d_Dates[Month Short], d_Dates[Month Number] ),
ORDERBY ( d_Dates[Month Number] )
)
)
YTD 2LM =
CALCULATE (
[YTD sum],
OFFSET (
-2,
ALLSELECTED ( d_Dates[Year], d_Dates[Month Short], d_Dates[Month Number] ),
ORDERBY ( d_Dates[Month Number] )
)
)
Por favor, vea el ejemplo de pbix adjunto.
Hola @PatilPrasad027 , ¿puedes probar con la siguiente lógica?
Datos reales desplazados hasta la fecha =
VAR CurrentDate = MAX('Date'[Date])
VAR ShiftedDate = EOMONTH(CurrentDate, -1)
DEVOLUCIÓN
CALCULAR(
[Datos reales hasta la fecha],
DATESINPERIOD('Fecha'[Fecha], FechaDesplazada, MES, 1)
)
funciona por mes, en lugar de mes, reemplace por Año y verifique.
Si esta publicación Ayuda, entonces por favor considere Acéptalo como la solución para ayudar a los demás miembros a encontrarlo más rápidamente.
Gracias @rajendraongole1
Es correcto,
solo un ligero cambio en el cálculo según mi requisito,
¡Bien! @PatilPrasad027
Si esta publicación Ayuda, entonces por favor considere Acéptalo como la solución o dar un saludo
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.