Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Return Current or Latest if Current is not Available

Hi,    I have a monthly FX table.    And on my fact table, I want to lookup the monthly FX. For future Delivery Date (ie. Dec 2022 and Jan 2023), I want to return the latest month (ie. Nov ...
  • Ashish_Mathur's avatar
    3 years ago

    Hi,

    Write this calculated column formula in Table 2

    FX for calc. = lookupvalue('Table 1'[Fx],'Table 1'[Calendar]Date],calculate(max('Table 1'[Calendar Date]),filter('Table 1','Table 1'[Calendar Date]<=earlier('Table 2'[Delivery Date])))

    Hope this helps.