Forum Discussion
YTD expression return Last yr value , Can it use button to switch to display Current year value ?
- 4 years ago
Hi Paul,
Couple of things: Have you gone through the process of marking your Date table as a calendar table? (Right click the table name from your Fields pane > Mark as date table > Mark as date Table > select your unique date column)
If so, then you can simplify your expression to just be:
CALCULATE ( [SALES], DATESYTD('DATES'[Date]) )Then you can add a year slicer to your canvas. Whichever year you select will give you the YTD value for that value for that year.
Cheers
Hi Paul,
Couple of things: Have you gone through the process of marking your Date table as a calendar table? (Right click the table name from your Fields pane > Mark as date table > Mark as date Table > select your unique date column)
If so, then you can simplify your expression to just be:
CALCULATE (
[SALES],
DATESYTD('DATES'[Date])
)
Then you can add a year slicer to your canvas. Whichever year you select will give you the YTD value for that value for that year.
Cheers