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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
AndrejZitnay
Post Patron
Post Patron

Help with openning and closed balance

Hello all,

 

Would you be so kind and help me out with openning and closed balances?

I have 4 measures from 3 tables and 1 merge date table for months.

 

I struggle to find solution for openning and closed balance.

 

Many thanks.

 

Andrej

 

Opening and closing balance.JPG

1 ACCEPTED SOLUTION

@AndrejZitnay , One month less should do

 

Opening balance = CALCULATE([All measure ],filter(allselected(Table),Table[Date] <=maxX(Table, dateadd(Table[Date],-1, month))))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

@AndrejZitnay , I am hoping you are using a common date table 

 

Sum of all the measures other then opening balance

 

All measure = [Measure from Table 1] + ....

 

Closing balance  = CALCULATE([All measure ],filter(allselected(Table),Table[Date] <=max(Table[Date])))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hello @amitchandak ,

 

Can I have one follow up question?

I have my table for 3 years and at the end I'll end up with zero.

That's fine.

 

For another calculation I have to add together ClosingBalance & Monthly new.

(this is my base for series of important measures)

 

All my measures are fine on monthly basis but total for the year or overall 3 years doens't add up.

 

I think that comes with nature of Closing Balance Formula)

It is not possible to sum all motnhs together.

 

Is there some separate work around where I could sum my closing balances?
That will be just base of my follow up measurments.

 

thanks.

 

Andrej

 

Hello @amitchandak 

 

You are star.

I have my closing balance now.

 

How I can get opening balance?

I know that it should be closing balance from last month.

 

Thanks.

 

Andrej

@AndrejZitnay , One month less should do

 

Opening balance = CALCULATE([All measure ],filter(allselected(Table),Table[Date] <=maxX(Table, dateadd(Table[Date],-1, month))))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hi, I applied to my problem but i faced dependency problem. You use filter so i wrote my calculated closing balance (that depends on opeing balance with formulas) to a table as calculated column and try to find opening balance

@amitchandak 

thank you very much.

Much appreaciated.

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.