Hello Everyone,
Last 2 weeks I’m fighting with a problem how to calculate a forecasted cash closing balance based on actuals & daily / weekly cashflows forecasted for the “to go” days/weeks.
The key purpose of this is to monitor cashbalance and predict if not run out. In the near future I would also like to add two slicers each with ratio from 50% to 150% and multiply forecaste outflows and inflows respectively by the selected ratio -> it would give me a kind of sensitivity analys saying if we underperform in cashinflows to 90% of forecast/plan and overperform in expense to 110% of what was expected the closing cash balance would be X.
My date is:
- Fact Table with Actual daily transactions - it comes from a bank csv generated file with all the transactions. What may be important here, it also includes cash closing balance as at 31 Dec 2020.
- Fact table with Budgeted daily cash flow - originally it was monthly typical budget but somehow I transfromed it into expected daily cash out- and inflows.
- DateTable
The expected outcome would reflect the logic:
if the selected data range is today or earlier provide the actual cash balance as at the date However if the selected data range is in the future, the measure would return forecasted cash balance as at the future day computed like:
[CashClosingBalance as at MaxActualDate] + Cummulated CashFlows From MaxActualDate to the SelectedDate.
As my model is right now full of detailed actual and confidential data I prepared a fantom data here.
So, let say I started a year with CashBalance of 1000. The Actuals are as at 10 Jan 2021 and after all the transactions from the begining of the year my cash balance is 923. Then my plan for the next days are spend 354 (from 11 to 31 Jan) and earn 591. It means my forecasted month closing balance is 923 - 354 + 591 = 1160.
The issues I faced and would love to be eliminated are:
- CashClosingBalance no value as at 3/01 when no Actual CashFlows - it should repeat value from previous available day
- No CashClosingBalance for future dates i.e. from 11 Jan
- #2 results in not correct chart
- ClosingBalance of 2000 as at 31Dec2020
CashClosingBalance.xlsx (22.7 KB) fantom data.pbix (90.3 KB)
I was trying to Summarize / Union both fact tables somehow but also failed.