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
Anonymous
Not applicable

Last month calculation got wrong result when show by daily

Dear Team,

I would like to seek support from team, I am facing calculation of last month and got imporper result when show by dialy.

calculate MtdAct:  CALCULATE(sum(SaleInvMovement[SaleAmt_Amt]),DATESMTD('Date'[Date]))

calulate LM_MtdAct: CALCULATE(MeasureTable[MtdAct],DATEADD('Date'[Date],-1,MONTH))

 

Result.JPG

 I am apreciated for help. Thanks

LC Aynar

2 REPLIES 2
JFAR49ER
Frequent Visitor

Hi, 

Could you possibly use measure branching for this? 
I.e Calc Last Month MTDAct = CALCULATE([MtdAct], PREVIOUSMONTH('Date'[Date]))

PREVIOUSMONTH : Returns a table that contains a column of all dates from the previous month, based on the first date in the Dates column, in the current context. 
https://learn.microsoft.com/en-us/dax/previousmonth-function-dax
So your measure for this month is called in and then the filter is MTD but previous month.

Let me know if this works? Hope its helpful 🙂

 

Anonymous
Not applicable

Hi @JFAR49ER ,

 

Thanks your for your prompt help, however, the result is still improper figure stated below:

LM_MTDAct_new = CALCULATE(MeasureTable[MtdAct] ,PREVIOUSMONTH('Date'[Date]))
 
New result.JPG
 
I am appreciated for any solution. Thanks!
LCAynar

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.