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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

Last Balance according to an index

I have transactions that occur on the same date without any timestamps and I created an index to get the most recent transaction on that date.

 

Now I want to be able to get the ending balance of each month according to this index such as the highlighted. How should this be done?

 

snip.PNG

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I figured out the solution.

 

Last Date = CLOSINGBALANCEMONTH(SUMX('Transactions','Transactions'[Balance]), 'Transactions'[Date], LASTNONBLANK('Bank Transactions'[Index],MAX('Transactions'[Index])))

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

There is a few ways.

1. Create a flag for the last transaction date of the month and use that as the filter

2. Rank on Month-Year and date a choose on desc and choose one

3. Try a formula like this. This should also work on the amount or other values.

LAst Date = CALCULATE(max(Sales[Sales Date]), FILTER(Sales,Sales[Sales Date]=max(Sales[Sales Date])))

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p...

https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

I don't want the maximum amount, I want the last amount according to the index.

Anonymous
Not applicable

I figured out the solution.

 

Last Date = CLOSINGBALANCEMONTH(SUMX('Transactions','Transactions'[Balance]), 'Transactions'[Date], LASTNONBLANK('Bank Transactions'[Index],MAX('Transactions'[Index])))

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!

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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