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 have a problem with total value for YTD PY calculation. I need to analyse data based on specific date. So i need to compare values sold in dates range 01.01.2024-11.04.2024 and same period in previous year - 01.01.2023 - 11.04.2023. I`ve used following measures (using also date table which ends on 11.04.2024).
Current Year YTD:
Unfortunately, total value for YTD PY shows value for 30.04.2023 not 11.04.2023. How can I solve it?
Hi,
I am not clear about your question from the images that you have posted. Share some data to work with and show the expected result. If possible, please ensure column titles are in English.
Hi ,
Thanks for the solution @lukiz84 provided, and i want to offer some more information for user to refer to.
hello @monika992 , you can try the following measure.
ytd. Ilości YTD PY =
CALCULATE (
[Ilosci CY YTD],
SAMEPERIODLASTYEAR ( 'Tabela kalendarzowa'[Date] ),
'Tabela kalendarzowa'[Date] <= DATE ( 2024, 4, 11 )
)
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
read this 🙂
Differences between DATEADD and PARALLELPERIOD in DAX - SQLBI
hint: SAMEPERIODLASTYEAR uses DATEADD.
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 |
---|---|
109 | |
78 | |
66 | |
52 | |
50 |
User | Count |
---|---|
121 | |
120 | |
78 | |
63 | |
62 |