The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi,
I'm comparing the MTD sales for the same period of two years, by using below measures:
Current MTD $ = TOTALMTD([Total Sales],DATESMTD(Sales[Invoice Date]))
Product Number | Current MTD $ | Same Priod Last Year MTD $ |
764414 | $ 205,000 | $ 205,000 |
Correct result should be:
Product Number | Current MTD $ | Same Priod Last Year MTD $ |
764414 | $ 0 | $ 205,000 |
Can anyone help on this error? Thank you!
Hi @MC_2023 ,
Please try:
SPLY MTD $ =
CALCULATE (
[Current MTD $],
SAMEPERIODLASTYEAR ( 'Date'[Date] ),
ALLEXCEPT ( 'Sales', 'Sales'[Product Number] )
)
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Hi,
Try using your date table for your MTD calculation also in your base measure:
Current MTD $ = TOTALMTD([Total Sales],DATESMTD('Date'[Date]))
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/
Proud to be a Super User!
Hi,
I amend the Current MTD $ per your suggestion, but it cannot return any figures...it's weird..
Anyway, thanks for your kind suggestion.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
21 | |
21 | |
18 | |
17 | |
13 |
User | Count |
---|---|
41 | |
38 | |
24 | |
20 | |
20 |