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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
browna6
Frequent Visitor

Calculating 3 months in from MAX date

Hi

 

I have the following calculation suming up 3 months from my max date in the table - which is working correctly

 

Max 3 months sum =
CALCULATE (Table[Market Value €],DATESINPERIOD('Dates'[Month],MAX('Dates'[Month]),-3,MONTH))

 

However, how can i then sum up the previous 3 months of that from my max date. So i want to calculate from -6 months in from the Max month in my date's measure to -3 in 

 

Thank you in advanced 

3 REPLIES 3
croberts21
Continued Contributor
Continued Contributor

Can you give us the max date you will use, then the resulting begin and end dates? 

 

So if the max date is June 1, 2022 then we want to sum March 1, 2022 through June 1 2022? Is that right?

Hi. So if the Max date was Dec 2022 - i would like to show the sum of July 2022, Aug 2022 & September 2022. Thanks 

Anonymous
Not applicable

Hi @browna6 ,

 

try this:

Measure = 
VAR _max_date = MAX('Dates'[Date])
VAR _start_date = EOMONTH(_max_date,-6)+1
VAR _end_date = EOMONTH(_max_date,-3)
VAR _totals = CALCULATE(SUM('Table'[Market Value €]),'Dates'[Date]>=_start_date&&'Dates'[Date]<=_end_date)
RETURN
_totals

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors