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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
jburklund
Helper III
Helper III

Running 12 Month Cash Balance with Opening Cash

I'm having trouble with an additive formula to calculate a running cash total. I have an opening cash measure that looks up the opening cash balance for that month in an Opening Cash table. For the first month I simply need to add Opening Cash + Operating Revenue + Operating Expenses to find the End Balance. I'm having trouble getting the End Balance from Month 1 to carry over as a Beginning Balance in Month 2 and so on.

Below is my current matrix visual, missing the Beginnning Balance measure, a breakdown of the measures, and a sample of the data and structure. I would appreciate any help. I've gotten close but keep running into circular reference errors. 

jburklund_0-1715360065187.png

 

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @jburklund ,

Ending cash should be the cumulative cash balance at monthend just like any other real account in the balance sheet. Try this:

ending cash =
CALCULATE (
    [opening cash] + [operating revenue] - [operating expenses],
    FILTER ( ALL ( dates ), dates[date] <= MAX ( dates[date] ) )
)

 

The measure above makes use of a separate dates table. If you don't have one, you can create by using DISTINCT(facttable[Date]) and then create one to many single direction relationship from this Dates table to your fact table.

 

If this doesn't answer your question, as always, please provide workable sample data (not an image) and your expected result from that. You may post post a link to an Excel file hosted in the cloud (dropbox, g/onedrive, etc.) Please refer to this post on how to get your question answered faster https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/td-p/144... 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

I have solved a similar problem in the attached files.


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

Hi @jburklund ,

Ending cash should be the cumulative cash balance at monthend just like any other real account in the balance sheet. Try this:

ending cash =
CALCULATE (
    [opening cash] + [operating revenue] - [operating expenses],
    FILTER ( ALL ( dates ), dates[date] <= MAX ( dates[date] ) )
)

 

The measure above makes use of a separate dates table. If you don't have one, you can create by using DISTINCT(facttable[Date]) and then create one to many single direction relationship from this Dates table to your fact table.

 

If this doesn't answer your question, as always, please provide workable sample data (not an image) and your expected result from that. You may post post a link to an Excel file hosted in the cloud (dropbox, g/onedrive, etc.) Please refer to this post on how to get your question answered faster https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/td-p/144... 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Thank you! This worked great.

Helpful resources

Announcements
Europe Fabric Conference

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 Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.