Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
UCR522
Frequent Visitor

Comparar mes actual contra mes anterior a la misma fecha

Buenas tardes

 

He creado dos medidas para aplicarlas en un dashboard con segmentación de datos por mes:

 

Para los datos del mes seleccionado utilizo la fórmula:

Ing Bruto = sum('Pedidos'[Imp Bruto])
 
Para los datos del mes anterior:
Ing Bruto MAN = calculate(sum('Pedidos'[Imp Bruto]);DATEADD(Calendario[Fechas];-1;MONTH))
 
Esto me funciona cuando comparo dos meses cerrados (por ejemplo, oct 2019 vs sep2019). Pero cuando comparo el mes actual quiero que me compare los datos de este mes con el mes anterior a la misma fecha. Es decir, si hoy es 28 de noviembre quiero que los datos del mes anterior sean los acumulados a 28 de octubre.
 
Alguien puede ayudarme con la fórmula?
 
Gracias.
 
1 REPLY 1
Cristian_Angyal
Advocate III
Advocate III

I'm not a Spanish speaker but if Google translation was right you might be able to use this formula:

 

Ing Bruto MAN =
CALCULATE (
    SUM ( 'Pedidos'[Imp Bruto] ),
    DATESINPERIOD ( 'Calendar'[Dates], MAX ( 'Calendar'[Dates] )-1MONTH )
)

 

If you liked my solution please give it a thumbs up 👍

If I did answer your question please mark my post as a solution .

Thank you !

 

 

Cristian

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors