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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
georgemaka
New Member

Excel Power Pivot Measure - 12 Month Sum DAX Incorrect

I am trying to create a measure that totals the past 12 months of revenue in Power Pivot. I have a date table and my data table linked. I created a Revenue measure that is calculating correctly

 

Revenues:=-CALCULATE(SUM('Data'[Revenue]))

I create a 12 MTD Revenue measure that looks correct, but one I put it in a pivot table by month, it is only pulling the current month's revenue total rather than a sum of the past 12 months.

 

Any ideas?

 

12 MTD Revenue:=CALCULATE(
		[Revenues],
DATESINPERIOD('Calendar'[Date],MAX('Data'[End Month]), -12, MONTH))

 

3 REPLIES 3
wdx223_Daniel
Super User
Super User

have you marked your calendar table as date table?

v-kkf-msft
Community Support
Community Support

Hi @georgemaka ,

 

Did you add the year and month columns from the Calendar table to the chart?

I was able to return the correct results using your measures.

 

vkkfmsft_0-1659420572147.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

lbendlin
Super User
Super User

12 MTD Revenue:= var m = MAX('Data'[End Month]) return CALCULATE([Revenues],'Data'[End Month]>EDATE(m,-12))

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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 Kudoed Authors