cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Helper II

## 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?

1 ACCEPTED SOLUTION
Helper II

I figured out the solution.

Last Date = CLOSINGBALANCEMONTH(SUMX('Transactions','Transactions'[Balance]), 'Transactions'[Date], LASTNONBLANK('Bank Transactions'[Index],MAX('Transactions'[Index])))
3 REPLIES 3
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

Helper II

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

Helper II

I figured out the solution.

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

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

#### Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors
Top Kudoed Authors