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
Anonymous
Not applicable

Mostrar la suma de los últimos 3 meses en la tarjeta

Así que tengo algunos datos que se ven así.
Enero-201000
Feb-202000
Mar-203000
Abr-204000
20 de mayo5000
Junio-206000
Y quiero mostrar los últimos 3 meses SUM. Ya que estamos en junio ahora quiero mostrar la suma para marzo + abril + mayo, pero cuando uso la fórmula siguiente obtengo abril + mayo + junio.
CALCULATE(SUM(Data[Social engagements]),DATESINPERIOD(Data[Date],LASTDATE(Data[Date]),-3,MONTH))
¿Qué estoy haciendo mal?
Gracias
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Andrew1 , Probar como

Rolling 3 hasta el último 1 mes - CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],ENDOFMONTH(dateadd(Sales[Sales Date],-1,month)),-3,MONTH))

View solution in original post

3 REPLIES 3
ryan_mayu
Super User
Super User

@Andrew1

también se puede probar a continuación medida

Measure = 
VAR maxdate=max('Sheet2'[date]) 
VAR startdate=date(year(maxdate),month(maxdate)-2,1)
return CALCULATE(sum(Sheet2[value]),FILTER('date','date'[Date]<=maxdate&&'date'[Date]>=startdate))

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




amitchandak
Super User
Super User

@Andrew1 , Probar como

Rolling 3 hasta el último 1 mes - CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],ENDOFMONTH(dateadd(Sales[Sales Date],-1,month)),-3,MONTH))

Anonymous
Not applicable

Funciona muy bien! Muchas gracias.

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.