Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Return Last Known Balance for each Account

Hi!

 

I have the following data:

 

Table name: Reconciliation

Date IDAccount ID  Balance  
20240101  A100
20240201A200
20240301B300

I also have a date table connected to the Date ID
I want the function to return the last balance for the last date relative to the filtered month.

 

What I want

In the end I want create a matrix visual that with Dates[YYYYMM] as columns, Reconciliation[Account ID] as rows and the newly created Measure "Last Balace" as values :

 202401  202402  202403  
A100200200
B  300


What I've tried
I've tried this formula but it leaves the last A account Blank.

 

LastBalance = 
CALCULATE(SUM(Reconciliation[Balance]),
Reconciliation[Date ID] = MAX(Reconciliation[Date ID]))

 

 202401  202402  202403  
A100200*
B  300

 

The Problem

This leaves the last month for the A account Empty*
Any help would be much appreciated!