Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Godfrey
New Member

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!

2 ACCEPTED SOLUTIONS
MattAllington
Community Champion
Community Champion

It's all covered in this article 

https://www.daxpatterns.com/semi-additive-calculations/



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1712453965693.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1712453965693.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
MattAllington
Community Champion
Community Champion

It's all covered in this article 

https://www.daxpatterns.com/semi-additive-calculations/



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors