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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

YTD not working

Hi all,

 

I have a question that is stumping me and I cannot figure it out. I suspect it is something simple but here we go anyway.

 

I have a table which has a date column, there are dates in the future in this table. I also have a calendar table and the relationships are setup.

 

In a measure I am using Calculate with Datesytd.

 

Expected_YTD = CALCULATE(sum(MadeUpTableName[Col1]), DATESYTD('Calendar'[Date]))

 

There is a slicer on the visual page allowing the user to select the year. There is no month slicer.

 

However, this measure always shows the full year sums, rather than just up to today. I suspect this is there is nothing telling it to use today as the 'end' date.

 

Any ideas?

1 ACCEPTED SOLUTION
StefanoGrimaldi
Resident Rockstar
Resident Rockstar

hey, 

 

thats right you need to make it change to check until today, try something like this:

Measure = CALCULATE(SUM(Table1[value]),YEAR(Table1[date]) = YEAR(TODAY()), MONTH(Table1[date]) <= MONTH(TODAY()) )

 




Did I answer your question? Mark my post as a solution! / Did it help? Give some Kudos!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
StefanoGrimaldi
Resident Rockstar
Resident Rockstar

hey, 

 

thats right you need to make it change to check until today, try something like this:

Measure = CALCULATE(SUM(Table1[value]),YEAR(Table1[date]) = YEAR(TODAY()), MONTH(Table1[date]) <= MONTH(TODAY()) )

 




Did I answer your question? Mark my post as a solution! / Did it help? Give some Kudos!

Proud to be a Super User!




Anonymous
Not applicable

You are a super star, thank you so much 🙂

 

I wasted so much of my afternoon scratching my head at this lol... oh well, its all a learning experiance I guess 😄

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.