cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
VinhTon
Helper I
Helper I

How to calculate the sum X months ago?

Calculate(  sum( value) ,previousmonth( date ) ) will give me last month but how do I pick before that? Like 3 months ago for example

1 ACCEPTED SOLUTION
tackytechtom
Super User
Super User

Hi @VinhTon ,

 

How about this:

CALCULATE ( 
   SUM ( table[value] ),
   DATEADD(table[date], -3, MONTH)
) 

Let me know if this helps 🙂

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/ 





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

Proud to be a Super User!




View solution in original post

3 REPLIES 3
tackytechtom
Super User
Super User

Hi @VinhTon ,

 

How about this:

CALCULATE ( 
   SUM ( table[value] ),
   DATEADD(table[date], -3, MONTH)
) 

Let me know if this helps 🙂

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/ 





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

Proud to be a Super User!




worked like a charm, thanks!

fhill
Resident Rockstar
Resident Rockstar

Here's a quick way.... (probably not the best way, that would be to define your Start and End Dates in a search or serach for a YYYYMM match on a Month Table?)

Calculate(  sum( value) ,previousmonth( DATEADD( date, -2, months) ) )




Did I answer your question, or help you along the way?
Please give Kudos or Mark as a Solution!


https://www.linkedin.com/in/forrest-hill-04480730/

Proud to give back to the community!
Thank You!




Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors