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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Top Solution Authors
Top Kudoed Authors