Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hello,
the calculation for Prev MTD is like this
Last MTD = CALCULATE(sum(DAILYTRANSACTIONS[Amount]), DATEADD(DATESMTD(YEAR_MONTH_DIMENSION_TAB[Date]), -1, MONTH))
The value is showing if only I selected month filter as Feb 2017.
And for this
Prev MTD = CALCULATE(DAILYTRANSACTIONS[Amount MTD], SAMEPERIODLASTYEAR(YEAR_MONTH_DIMENSION_TAB[Date]))
It shows Dec 2016 value instead of Jan 2017.
Any help would be appreciated.
Thanks
Solved! Go to Solution.
Hi @Kpower,
You can refer to below formula to calculate the running total and the previous running total.
Measures:
RunningTotal = CALCULATE(SUM('Table'[Amount]),FILTER(ALL('Table'),'Table'[Date]<=MAX('Table'[Date]))) PreviousRunningTotal = var temp=MAX('Table'[Date]) Return CALCULATE(SUM('Table'[Amount]),FILTER(ALL('Table'),'Table'[Date]<=DATE(YEAR(temp),MONTH(temp)-1,DAY(temp))))
Regards,
Xiaoxin Sheng
Hi @Kpower,
You can refer to below formula to calculate the running total and the previous running total.
Measures:
RunningTotal = CALCULATE(SUM('Table'[Amount]),FILTER(ALL('Table'),'Table'[Date]<=MAX('Table'[Date]))) PreviousRunningTotal = var temp=MAX('Table'[Date]) Return CALCULATE(SUM('Table'[Amount]),FILTER(ALL('Table'),'Table'[Date]<=DATE(YEAR(temp),MONTH(temp)-1,DAY(temp))))
Regards,
Xiaoxin Sheng
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
82 | |
81 | |
52 | |
39 | |
35 |
User | Count |
---|---|
95 | |
79 | |
52 | |
49 | |
47 |