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
Nesquick91
New Member

Last month calculation

Hello,
I'm have being learning Power BI for last the week using online platforms. I'm on the practising stage doing models and visualisations.
I'm on my third report but stuck on the following and cannot move on.
 
I have several tables similar to this one:
9joevyr1zx251.png

 

First I calculate the total value by doing a sum of all values of all columns in all tables and  this went well.
(Total Expenses = Sum(table1[value]) + sum(table2[value])...).
 
Second, I tried to get the last month total value and didn´t work so well. 
Last Month total € spent = CALCULATE([Total Expenses],PREVIOUSMONTH('Calendar'[Date]))
I tried also with the Filter() function or PARALLELPERIOD() and DATEADD() in different ways and forms. Here some other functions I used:
Last Month total € spent = IF(MAX('Calendar'[Start of Month].[Month])<TODAY(),CALCULATE([T
otal Expenses]),DATEADD('Calendar'[Start of Month].[Month],-1,MONTH))
 
Last Month total € spent = IF(MAX('Calendar'[Date])<TODAY(),CALCULATE([Total Expenses]),DATEADD('Calendar'[Date],-1,MONTH)).
 
This is the table I get using the Total Expenses function:
908sm5v30y251.png

 

 
This is the table I get using the Last Month total € spent function:
 ux9oej9d0y251.png

 

 
This is the result that I want:
ql26tabn0y251.png

 

 
 
Can anybody help? Sorry if didn't use the correct terms or reported on the correct terms.
Thanks.
2 REPLIES 2
stevedep
Memorable Member
Memorable Member

Anonymous
Not applicable

https://dax.guide/previousmonth/

 

Please create the correct relationships between your tables. Especially from Calendar and your fact tables. By the way, your Calendar table must be marked as the Date table in the model for time-intel functions to work correctly.

 

Best

D

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.