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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
johnandrews1987
New Member

DAX to work out the Previous Months Total

Total Last Month = CALCULATE(SUM('Report Data'[Amount]),DATEADD('Date'[FullDateAlternateKey].[Date],-1,MONTH)
 
This DAX works great, for every month except January, where I'd like to get the previous Years December figures.

Any ideas? I thought an IF statement might work but I couldn't get it to.
1 ACCEPTED SOLUTION

@johnandrews1987 

 

Try this

Total Last Month = 
CALCULATE(
	SUM('Report Data'[Amount]),
	PREVIOUSMONTH('Date'[FullDateAlternateKey])
)

Requires that you have a date table and that it is marked as one.

View solution in original post

3 REPLIES 3
littlemojopuppy
Community Champion
Community Champion

@johnandrews1987 question for you: are you intending for the total on the date one month prior?  Or the total for the entire previous month?

@littlemojopuppy - it would be for the entire previous calendar month, so in January, what did we do in December. Thanks!

@johnandrews1987 

 

Try this

Total Last Month = 
CALCULATE(
	SUM('Report Data'[Amount]),
	PREVIOUSMONTH('Date'[FullDateAlternateKey])
)

Requires that you have a date table and that it is marked as one.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.