Forum Discussion

gumis_rulez's avatar
gumis_rulez
Helper I
1 year ago
Solved

Problem with measure limits

I want to have a measure which calculates Checkouts YTD - and this works well; and second measure which calculates Checkouts LYTD till the date I have data in fct table.   Checkouts = CALCULATE( ...
  • Selva-Salimi's avatar
    1 year ago

    Hi gumis_rulez 

     

    you should update your LYTD measure as follows:

     

    Checkouts LYTD =
    VAR _Max = MAX('fct_Hotel Revenue'[Reservation Status Date])
    VAR LastSaleDatePY = EDATE ( _max, -12 )

    RETURN
    CALCULATE(
        [Checkouts YTD]
        ,SAMEPERIODLASTYEAR(dim_Calendar[Date]),
        dim_Calendar[Date] <= LastSaleDatePY
    )
     
    If this post helps, then I would appreciate a thumbs up ๐Ÿ‘ and mark it as the solution to help the other members find it more quickly.