Forum Discussion

andrewb95's avatar
andrewb95
Helper II
5 years ago
Solved

Take a value from a set time.

I have a data table like this, it is real time and updates regularly. The value can change at any time.    Date Company Name Value 01.01.2020 A 5 01.02.2020 B 12   I want to tak...
  • v-xicai's avatar
    5 years ago

    Hi andrewb95 ,

     

    You may create a measure like DAX below, in which the variable _PrevDate is to get the previous date before current max date of table.

     

    Value Specific Date=
    
    var _PrevDate = CALCULATE(MAX('Table'[Date]), FILTER( ALLEXCEPT('Table', 'Table'[Company Name]), 'Table'[ Date] <  MAX('Table'[ Date])))
    return
    
    CALCULATE(FIRSTNONBLANK('Table'[Value], 1),  FILTER( ALLEXCEPT('Table', 'Table'[Company Name]), 'Table'[ Date]= _PrevDate))

     

    Best Regards,

    Amy 

     

    Community Support Team _ Amy

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.