Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Days Between Slicer Dates in Measure

Hi,    I am trying to create a measure the calculates a straigt line average across my slicer range. I am having trouble setting the 'Remaining Days' (from my slicer delta and my last date of sales...
  • v-cherch-msft's avatar
    7 years ago

    Hi Anonymous

     

    You may try below measure:

    Remaining Days =
    VAR a =
        FIRSTDATE ( 'Calendar'[Date] )
    VAR b =
        CALCULATE ( MAX ( 'Calendar'[Date] ), ALLSELECTED ( 'Calendar'[Date] ) )
    RETURN
        DATEDIFF ( a, b, DAY )
    

    Regards,

    Cherie