Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
Hello everyone,
I need some help with my HL-YTD measure:
The issue is that it does not return data for Week 1 of 2025. In my dataset, Week 1 of 2025 starts on December 29, 2024, and ends on January 4, 2025. However, the measure works correctly for Week 2 of January 2025.
Interestingly, the same measure works fine for Week 1 of 2024, which starts on December 31, 2023, and ends on January 6, 2024.
Could this be related to how TOTALYTD handles year transitions? How can I modify the measure to ensure it includes Week 1 of 2025?
Thanks in advance for your help!
Solved! Go to Solution.
@sujana_m please try reading free Microsof Learn page before asking questions.
You will get quick and better question and learn new skills.
https://learn.microsoft.com/en-us/dax/totalytd-function-dax#
So for a year starting on December 29, 2024 your solution is
HL-YTD = TOTALYTD([HL], 'DATE'[DATE],,"12/28")
If each year has a different week start date, then try create a CALENDAR table with a week number column and use a CALCULATE. I tend to avoid TOTALYTD and always prefer to use a CALENDAR table and CALCULATE because if a customer or supplier changes their year start dates, then I just needs need to change the calendar and dont need to build and retest the DAX formulas.
Please click [accept solution] and thumbs buttons to show your appreciation, thanks 😀
@sujana_m You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000
Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...
@sujana_m please try reading free Microsof Learn page before asking questions.
You will get quick and better question and learn new skills.
https://learn.microsoft.com/en-us/dax/totalytd-function-dax#
So for a year starting on December 29, 2024 your solution is
HL-YTD = TOTALYTD([HL], 'DATE'[DATE],,"12/28")
If each year has a different week start date, then try create a CALENDAR table with a week number column and use a CALCULATE. I tend to avoid TOTALYTD and always prefer to use a CALENDAR table and CALCULATE because if a customer or supplier changes their year start dates, then I just needs need to change the calendar and dont need to build and retest the DAX formulas.
Please click [accept solution] and thumbs buttons to show your appreciation, thanks 😀
Hi @sujana_m ,
If your dataset uses a fiscal year or custom calendar where Week 1 of the new year begins in the previous year's December, you can use the TOTALYTD function's optional year_end_date parameter to specify a custom year-end date:
Update your DAX for this:
HL-YTD = TOTALYTD([HL], 'DATE'[DATE], "12/28")
"12/28" is an example of the custom year-end date, meaning the year boundary occurs on December 28. Adjust it based on your specific dataset.
You can learn more about TOTALYTD function here
Hi @sujana_m ,
If your dataset uses a fiscal year or custom calendar where Week 1 of the new year begins in the previous year's December, you can use the TOTALYTD function's optional year_end_date parameter to specify a custom year-end date:
Update your DAX for this:
HL-YTD = TOTALYTD([HL], 'DATE'[DATE], "12/28")
"12/28" is an example of the custom year-end date, meaning the year boundary occurs on December 28. Adjust it based on your specific dataset.
You can learn more about TOTALYTD function here