I am trying to visualise bank balance trend, i am facing error while trying to create powerbi dax for this.
My data is in the following table format:
`Date,closing_balance,bank_name
2023-05-25 00:00:00,1356.36,SBI
2023-05-24 00:00:00,133551.92,HDFC
2023-05-23 00:00:00,119257.15,HDFC
2023-05-22 00:00:00,124573.15,HDFC
2023-05-19 00:00:00,124583.15,HDFC
2023-05-18 00:00:00,104639.15,HDFC
2023-05-18 00:00:00,7856.36,SBI`
The dates with where no transactions were done are missing, also when in matrix nd trying to separte by bank , there are null spaces which are considered as 0 for trend. i want to fill the null spaces by the last closing balance. How to? i have tried the following.
Balance Measure =
VAR CurrentDate = Bank[transaction_date]
VAR BankName = Bank[bank_name]
RETURN
CALCULATE(
LASTNONBLANK(
Bank[balance],
1
),
FILTER(
ALLEXCEPT(Bank, Bank[bank_name]),
Bank[bank_name] = BankName
&& Bank[transaction_date] <= CurrentDate
)
)
