Hi All,
I am working on a report showing daily cash balances. I have three tables in my data model:
a) table with daily transactions in different entities and in different currencies (BANK_NAV_ALL)
b) dates table (DATES)
c) FX table (where daily FX rates are stored, period covered: 01/01/2013 - 31/07/2023) (MONTH_END_RATES)
Table a) is connected with table b) by date and similarly, table c) is also connected with table b) by date.
My goal is to recalculate balances in different currencies from table a) to USD using FX rates from table c). Daily balances are cumulative, i.e. when I want to calculate a balance in a given currency as of today, I have to sum up all the entries up to that date.
I prepared a simple table in which I want to lookup a rate for a selected currency and selected date. I am using LOOKUPVALUE function, which looks as below:
LOOKUPVALUE( MONTH_END_RATES[Month-end FX rate],
MONTH_END_RATES[Date], VALUES( DATES[Date] ) ,
MONTH_END_RATES[Currency], VALUES(BANK_NAV_ALL[LCY] ) )
And the results are shown in the table below:
As you can see, there are many blanks in the table. I was wondering why is that but discovered that I get blanks if there are no entries booked with a given date. For example, there were no any bookings for CZK on 31st July 2023. The problem is that I would like to show a balance for that date, so I need to find a proper FX rate.
Is there any way to display FX rates values for each date, despite the fact that table a) does not contain entries under each date and each currency?
Many thanks for any help!