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 September 15. Request your voucher.

Reply
SachinFG
Frequent Visitor

Last month Vs Current Month DAX query

Hi All,

 

I am trying to compare this month till date purchase amount with last month ( same no of days) in Power BI. 

 

The below are the queries for MTD and LMTD :

 

MTD:

 PurchaseAmount_MTD = Calculate(SUM(Schedule[ESC_PURCHASE_AMOUNT]),DATESMTD('Date'[Date]))

 

LMTD:

PurchaseAmount_LastMonth = Calculate( sum(Schedule[ESC_PURCHASE_AMOUNT]),DATEADD('Date'[Date],-1,MONTH))
PurchaseAmount_LMTD = Calculate([PurchaseAmount_LastMonth],DATESMTD('Date'[Date]))
 
The below is the output of the 2 queries (which is wrong).
 
Can anybody please help me?
Capture.PNG

1 REPLY 1
amitchandak
Super User
Super User

@SachinFG , This output seems correct.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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