Forum Discussion

admin11's avatar
admin11
Icon for Memorable Member rankMemorable Member
4 years ago
Solved

YTD expression return Last yr value , Can it use button to switch to display Current year value ?

Hi All   I have a issue , when i my Date expression :- CALENDAR(Date(2003,01,01),date(2021,12,31))   Today is Jan 18 2022 ,My YTD expression below it will return Last year Total sales amount.  ...
  • dvl_ctaul's avatar
    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