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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.