Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

show value based on current date

Hello, I have a Date table with columns such as DateKey, PreviousWorkingDateKey, etc. I would like to have a measure which shows the previousWorkingDateKey for today's DateKey How is ithis done pl...
  • v-lili6-msft's avatar
    v-lili6-msft
    6 years ago

    HI  Anonymous 

    If so, just adjust the formula as below:

    Measure 2 = 
    var _preworkingdatekey= calculate(max('Date'[PreviousWorkingDate]),filter('Date','Date'[DateValue] = today())) return
    DATE(VALUE(LEFT(_preworkingdatekey,4)),VALUE(MID(_preworkingdatekey,5,2)),VALUE(RIGHT(_preworkingdatekey,2)))

     

    Regards,

    Lin