The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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))
I am apreciated for help. Thanks
LC Aynar
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 🙂
Hi @JFAR49ER ,
Thanks your for your prompt help, however, the result is still improper figure stated below:
User | Count |
---|---|
11 | |
9 | |
6 | |
6 | |
5 |
User | Count |
---|---|
24 | |
14 | |
14 | |
9 | |
7 |