Forum Discussion
Truelearner
Helper III
6 years agoneed help with dax
I have the table below where in i have original currency and transaction currency along with effective date and exchnage rate ,
i have this requirement where in which i want to create a table with with highest date when i have two or more exchange rates within same month and i want to have a column in which i would like to have the previous month exchnage rate if the current exchnage rate is not available.
@mgwena @cham @amitchandak @Greg_Deckler @Mariusz
Input table :
| Original curr | Transaction Curr | Effective Date | Exchangerate |
| USD | INR | 02-01-2020 | 71 |
| USD | INR | 18-01-2020 | 72.05 |
| USD | EUR | 07-01-2020 | 14 |
| USD | INR | 04-02-2020 | 71.5 |
| USD | CAD | 07-02-2020 | 1.01 |
| USD | INR | 03-03-2020 | 72 |
Output Table :
| Original curr | Transaction Curr | Effective Date | Exchangerate | Previous exchnage rate |
| USD | INR | 18-01-2020 | 72.05 | |
| USD | EUR | 07-01-2020 | 14 | 72.0 |
| USD | CAD | 07-02-2020 | 1.01 | |
| USD | INR | 03-03-2020 | 72 | 14 |
Your result does seem in line with the description.
Please find solution at https://www.dropbox.com/s/ow37w9hj8aro25z/LastMonthExchnageRate.pbix?dl=0
Use Max month as filter