Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Helper IV
Helper IV

Calculate YTD relative to the End Date from the Date slicer


I have a Date Slicer for the report, and wantto display YTD measure.

When the End of Previous Year is within the Date Slicer selection, this is not a problem, but if for example the date slicer selects Feb 2022 to July 2022, then how do I get the data for Dec 2021 and July 2022 ?





YTD = CALCULATE( <your expression>, DATESYTD(LASTDATE('Date'[Date])), ALL(Date))


View solution in original post

Helper IV
Helper IV

Thank you. Had to modify a little bit to get ONLY THE FIRST MONTH, but you solved the key part of it. Thanks again.

                                  LASTDATE('Dates'[Date ID])
Resident Rockstar
Resident Rockstar

@Saniat ,

  1. Do you want YTD value based on the slicer's End date?
  2. For example, if you select Feb'22 to Jul'22,  do you need to calculate the value for Jan'22 to July'22?
  3. Do you have any date tables in your dataset?

1. yes
2. yes
3. yes - the slicer is based on that table



YTD = CALCULATE( <your expression>, DATESYTD(LASTDATE('Date'[Date])), ALL(Date))


Helpful resources

PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors