Forum Discussion

abloor's avatar
abloor
Icon for Helper IV rankHelper IV
6 years ago
Solved

Find most recent value

Hi, Can I please get some help in creating a column that uses a lookup to find a value?   See some data here: https://1drv.ms/u/s!AvZLa7VG1kXrghL-VePQJrtq06qC?e=hhMgQN   The first tab (Country)...
  • v-zhenbw-msft's avatar
    v-zhenbw-msft
    6 years ago

    Hi abloor ,

     

    We can create three columns in Budget table.

     

    Column = CALCULATE(MAX(Country[Country]),FILTER(Country,Country[Product]=Budget[Product] && Country[Date]=Budget[Date]))

     

    Column 2 = 
    var _min_date = CALCULATE(MIN(Budget[Date]),FILTER(Budget,Budget[Product]=EARLIER(Budget[Product])&&Budget[Column]<>BLANK()))
    return
    CALCULATE(MAX(Budget[Column]),FILTER(Budget,Budget[Product]=EARLIER(Budget[Product]) && Budget[Date]=_min_date))

     

    Country column = 
    IF(
        ISBLANK(Budget[Column]),Budget[Column 2],Budget[Column])

     

     

    If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

     

    Best regards,

     

    Community Support Team _ zhenbw

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

     

    BTW, pbix as attached.