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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
dw700d
Post Patron
Post Patron

Using Run Rate to Forecast Performance

I am on a project and we must spend $1,000,000 in 944 days. I am trying to create a tracker that highlights if we are on pace to accomplish this.  In the below example I calculate how many days it will take us to spend 1,000,000 dollars based on our current averages. For example on Day 7 I subtract the Sum of total inflows(5,500) from the Beginning balance (1,000,000). I then divide that total (994,500) by the average(785) cash outflow from days 1 -7. That tells me, at the current rate we will spend the money in 1,267 days.

 

How can I use this run rate to calculate how many days it will take me to spend a $1,000,000 by using DAX? 

 

dw700d_0-1594943328919.png

 

 

1 ACCEPTED SOLUTION
edhans
Community Champion
Community Champion

I can make it easy for you. DM me and I'll give you my bank account and you can send me the balance of the money. 😂

Seriously, try this:

 

VAR varCurrentDay =
    MAX( 'Table'[Day] )
VAR varAverageSpend =
    CALCULATE(
        AVERAGE( 'Table'[Cash Flow] ),
        FILTER(
            ALL( 'Table'[Day] ),
            'Table'[Day] > 0
                && 'Table'[Day] <= varCurrentDay
        )
    ) * -1
VAR varRemainingSpend =
    CALCULATE(
        SUM( 'Table'[Cash Flow] ),
        FILTER(
            ALL( 'Table'[Day] ),
            'Table'[Day] <= varCurrentDay
        )
    )
VAR Result =
    DIVIDE(
        varRemainingSpend,
        varAverageSpend,
        0
    )
RETURN
    Result

 

It returns this visual

edhans_0-1594945106900.png

My PBIX file is here if you want to see what I did. I made the Day count an integer as I needed to use that to filter the data. You can see in the measure that each variable is fairly simple in what it does - one gets the current day, the next the average through that day, then the total spend, then finally it does the division.

 

If you need further help, see links below to provide data. We cannot use screenshots for data. Great for expected results, but we have to retype stuff for source data.

 

How to get good help fast. Help us help you.
How to Get Your Question Answered Quickly
How to provide sample data in the Power BI Forum

 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

8 REPLIES 8
Anonymous
Not applicable

Hi @dw700d ,

You can create a calculated column as below:

Days Until Money is Spent = 
VAR _dayNum =
    RIGHT ( 'Table'[Day ], LEN ( 'Table'[Day ] ) - 4 )
VAR _culCash =
    CALCULATE (
        SUM ( 'Table'[Cash Flow] ),
        FILTER (
            ALL ( 'Table' ),
            RIGHT ( 'Table'[Day ], LEN ( 'Table'[Day ] ) - 4 ) <= _dayNum
        )
    )
VAR _aveCash =
    DIVIDE ( _culCash, _dayNum )
RETURN
    DIVIDE ( 1000000 - ABS( _culCash), ABS ( _aveCash ) )

Days Until Money is Spent.JPG

Best Regards

Rena

Ashish_Mathur
Super User
Super User

Hi,

It will depend upon how the data is arranged.  Share the link from where i can download your PBI file.


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

I can make it easy for you. DM me and I'll give you my bank account and you can send me the balance of the money. 😂

Seriously, try this:

 

VAR varCurrentDay =
    MAX( 'Table'[Day] )
VAR varAverageSpend =
    CALCULATE(
        AVERAGE( 'Table'[Cash Flow] ),
        FILTER(
            ALL( 'Table'[Day] ),
            'Table'[Day] > 0
                && 'Table'[Day] <= varCurrentDay
        )
    ) * -1
VAR varRemainingSpend =
    CALCULATE(
        SUM( 'Table'[Cash Flow] ),
        FILTER(
            ALL( 'Table'[Day] ),
            'Table'[Day] <= varCurrentDay
        )
    )
VAR Result =
    DIVIDE(
        varRemainingSpend,
        varAverageSpend,
        0
    )
RETURN
    Result

 

It returns this visual

edhans_0-1594945106900.png

My PBIX file is here if you want to see what I did. I made the Day count an integer as I needed to use that to filter the data. You can see in the measure that each variable is fairly simple in what it does - one gets the current day, the next the average through that day, then the total spend, then finally it does the division.

 

If you need further help, see links below to provide data. We cannot use screenshots for data. Great for expected results, but we have to retype stuff for source data.

 

How to get good help fast. Help us help you.
How to Get Your Question Answered Quickly
How to provide sample data in the Power BI Forum

 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Thanks for the help... Ill put in a word for yo 😂...

 

edhans
Community Champion
Community Champion

Thanks @dw700d - glad I was able to help out.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

@edhans I am trying to calculate the count of days  between todays date  and 2/16/23. I would like that count to update each day. Any thoughts on how I can accomplish that?

edhans
Community Champion
Community Champion

This will do that.

Measure = 
    DATEDIFF(
        TODAY(),
        DATE(2023,2,16),
        DAY
    )

Today it shows 941 days. 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
lbendlin
Super User
Super User

Create a line at $1M/944 = 1059  and then calculate the average of all your daily values to see if you are above or below 1059

Helpful resources

Announcements
FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.