This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreGet Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.
Hola equipo,
Me pregunto si podría ayudar, puede ser una simple edición de dax, pero no puedo ver. Tengo una medida del mes anterior en la que calcula el tamaño del volumen y muestra el valor sumado del último mes.
Problema: Cuando una persona selecciona un período en el campo de fecha. la medida del último mes hace un cálculo que es correcto, no es lo que estoy tratando de lograr. (mostrando 982,180.93)
Resultado: Estoy tratando de hacer que esa columna/medida sea estática y que si alguien elige un filtro de fecha, la medida debe ignorarlo y presentar el mes anterior en función de Hoy. El resultado alcanzado debería ser (210,700.89) como estoy en el mes 24 de enero.
La segmentación de filtros proviene de una tabla de fechas con una relación con la clasificación de distribuidores (fecha de negociación)
Así es como se ve:
Dax:
Pude entenderlo. Tuve que crear dos para el dax de abajo. Mi modelo tiene una tabla de fechas y una tabla de fechas personalizada (últimos 5 días, últimos 7 días, 40 días, etc.), así que cambié las fechas del dax para mirar las fechas y usé marcadores para completarlo.
Pero, ¿crees que podría tener esto en un interruptor? es decir, si se selecciona 1 filtro, muestra el compás 2, de lo contrario, si el otro muestra el compás 1??
VAR CurrentDate = TODAY()
VAR StartOfCurrentMonth = STARTOFMONTH('DIM Calendar (test)'[Date])
VAR StartOfPreviousMonth = EDATE(StartOfCurrentMonth, -1)
VAR EndOfPreviousMonth = EOMONTH(StartOfPreviousMonth, 0)
RETURN
IF(
[Ranking Size (Vol)] = BLANK(),
BLANK(),
IF(
[Ranking Size (Vol)] > 0,
CALCULATE(
[Ranking Size (Vol)],
ALL('DIM Calendar (test)'),
'DIM Calendar (test)'[Date] >= StartOfPreviousMonth,
'DIM Calendar (test)'[Date] <= EndOfPreviousMonth
)
)
)
Necesitas usar ALL() :
Ranking Size (Vol) previous month =
VAR CurrentDate = TODAY()
VAR StartOfCurrentMonth = STARTOFMONTH('DIM Calendar (test)'[Date])
VAR StartOfPreviousMonth = EDATE(StartOfCurrentMonth, -1)
VAR EndOfPreviousMonth = EOMONTH(StartOfPreviousMonth, 0)
RETURN
IF(
[Ranking Size (Vol)] = BLANK(),
BLANK(),
IF(
[Ranking Size (Vol)] > 0,
CALCULATE(
[Ranking Size (Vol)],
ALL('DIM Calendar (test)'),
'DIM Calendar (test)'[Date] >= StartOfPreviousMonth,
'DIM Calendar (test)'[Date] <= EndOfPreviousMonth
)
)
)
Hola @AmiraBedh
Gracias por la rápida respuesta.
Sin embargo, cuando hago eso. ¿Me devuelven datos en blanco?
¿Puedes compartir tu archivo pbix?
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.