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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.