Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
sujana_m
Frequent Visitor

Issue with TOTALYTD Not Returning Data for 2025 Week 1fined

Hello everyone,

I need some help with my HL-YTD measure:

 

DAX
HL-YTD = TOTALYTD([HL], 'DATE'[DATE])
 

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?

sujana_m_0-1737479412252.png

 

Thanks in advance for your help!

1 ACCEPTED SOLUTION
speedramps
Community Champion
Community Champion

@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#

 

speedramps_0-1737481195679.pngspeedramps_1-1737481222584.png

 

speedramps_2-1737481244326.png

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 😀

 

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

@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...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
speedramps
Community Champion
Community Champion

@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#

 

speedramps_0-1737481195679.pngspeedramps_1-1737481222584.png

 

speedramps_2-1737481244326.png

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 😀

 

Bibiano_Geraldo
Super User
Super User

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

Bibiano_Geraldo
Super User
Super User

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

Helpful resources

Announcements
Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

Top Solution Authors