Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi,
I'm struggling to get the Previous Year MTD calculation to work, and I'm trying to get the prior year month to date which is August 2021 only. How do I revise below formula for last year?
This is my formula to the get the current MTD
CURRENT_MTD = CALCULATE(SUM(Data[Sales_Amount]), FILTER(Data, Data[FISCAL_DATE] >= DATE(YEAR(TODAY()), MONTH(TODAY()), 01)), FILTER(Data, Data[FISCAL_DATE] < TODAY()))
Here is the result
Thanks bunch
Solved! Go to Solution.
I figured it out myself
CALCULATE(SUM(Data[Sales_Amount]),
FILTER(Data, Data[FISCAL_DATE] <= DATE(YEAR(TODAY())-1, MONTH(TODAY()), DAY(TODAY()))),
FILTER(Data, Data[FISCAL_DATE] >= DATE(YEAR(TODAY())-1, MONTH(TODAY()), 01)),
FILTER(Data, Data[FISCAL_DATE] < TODAY())
)
Result
I figured it out myself
CALCULATE(SUM(Data[Sales_Amount]),
FILTER(Data, Data[FISCAL_DATE] <= DATE(YEAR(TODAY())-1, MONTH(TODAY()), DAY(TODAY()))),
FILTER(Data, Data[FISCAL_DATE] >= DATE(YEAR(TODAY())-1, MONTH(TODAY()), 01)),
FILTER(Data, Data[FISCAL_DATE] < TODAY())
)
Result
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
112 | |
95 | |
92 | |
35 | |
29 |