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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

How to get Rolling total for forecast.

Hi Team,

 Can you please advise me how to calculate Runway (Rolling Total) in powerbi using DAX like below.

The below highlighed column is achived using Excel spreadsheet with Row No.  I am struggling to get it in powerbi DAX.

Runway by CF for Nov = Total of current forecast - forecast of Nov

Runways by CF for Dec onwards = Runway by CF - forecast of Dec  a and so on....

 

 

ashish_18_0-1721679050170.png

 

4 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Thanks Irwan. It works as column measure. For empty value,I can replace it with 0 for last month..right.?

Thanks for this solution buddy 🙂

View solution in original post

Its pretty easy. Just change the measure to this

 

 

RunAwayByCf = 
VAR _py =
    CALCULATE (
        IF ( SUM ( Data[CurrentForecast] ) = 0, 0, SUM ( Data[CurrentForecast] ) ),
        ALLEXCEPT ( Data, Data[FI Name]),
        MIN(Data[Index] ) <= Data[Index] -1
    )
RETURN
    INT ( _py )

 


which gives the following o/p. I have sorted it on FI Name so that its easy to validate the results.

SachinNandanwar_1-1721901662566.png

 



 

 



Regards,
Sachin
Check out my Blog

View solution in original post

Can you check if the DAX you are using is the same as one I posted last time ?

Recording 2024-07-26 at 21.18.38.gif

Now I am using the new code and I see no issues.




Regards,
Sachin
Check out my Blog

View solution in original post

Anonymous
Not applicable

HI @SachinNandanwar   its working with earlier code itself. 

 

Do u have any idea how to get Runway by Burn rate

Runway by Burn Rate calculated in excel 
Nov =SUM(C:C)-C2
Dec onwards = F2-E2,F3-E3,F4-E4
 
Expected result should show like this .
For CCC =--
IndexMonthSum of current costRunway by CCBurn RateRunway by Burn Rate
1Nov2182282819358253132.22819358
2Dec15940026599582182282566225.833
3Jan19064524693131906452347997.833
4Feb18313622861771831362157352.833
5Mar19396720922101939671974216.833
6Apr22977618624342297761780249.833
7May28392315785112839231550473.833
8Jun25777113207402577711266550.833
9Jul2805601040180253132.21008779.833
10Aug336528703652253132.2755647.6667
11Sep337392366260253132.2502515.5
12Oct3662600253132.2249383.3333

View solution in original post

36 REPLIES 36

Why are the burn rates for Nov same as July,Aug,Sep&Oct ?



Regards,
Sachin
Check out my Blog
Anonymous
Not applicable

because current month and future month should have average of all--as per requirement

Could you please mark the previous requirement solved ?



Regards,
Sachin
Check out my Blog
Anonymous
Not applicable

HI @SachinNandanwar    I am using below column measure to calculate burn rate.

burnrate1 = IF('Table'[Index]-2>=[CurrentMonthNo],'Table'[Avg],'Table'[Current Cost])

 

Avg = CALCULATE(AVERAGE('Table'[Current Cost]))
 
The requiremnt that for current or future month,burn rate is avg of current cost of all months. For past months,its same as current cost of that month as its already passed out.
 
I hope,this helps 

Sorry I dont fully understand your new requirements.

Could you please explain a bit more on how you are calculating Burn rate.Can you show the underlying calculations ?



Regards,
Sachin
Check out my Blog

Its pretty easy. Just change the measure to this

 

 

RunAwayByCf = 
VAR _py =
    CALCULATE (
        IF ( SUM ( Data[CurrentForecast] ) = 0, 0, SUM ( Data[CurrentForecast] ) ),
        ALLEXCEPT ( Data, Data[FI Name]),
        MIN(Data[Index] ) <= Data[Index] -1
    )
RETURN
    INT ( _py )

 


which gives the following o/p. I have sorted it on FI Name so that its easy to validate the results.

SachinNandanwar_1-1721901662566.png

 



 

 



Regards,
Sachin
Check out my Blog
Irwan
Super User
Super User

hello @Anonymous 

 

please check if this accomodate your need.

Runway by CF =
SUMX(
    FILTER(
        'Table',
        'Table'[Index]>EARLIER('Table'[Index])
    ),
    'Table'[Current Forecast]
)

Irwan_0-1721698502818.png

 

Hope this will help you.

Thank you.

Anonymous
Not applicable

Hi @Irwan  your result Runway by CF looks good to me but code is not working for me. Its giving me below error

 

ashish_18_0-1721701581675.png

 

@Anonymous 

 

please use calculated column for that DAX (not measure).

 

I got same error if I use that DAX in measure.

Irwan_0-1721702471041.png

 

Thank you

Anonymous
Not applicable

Thanks Irwan. It works as column measure. For empty value,I can replace it with 0 for last month..right.?

Thanks for this solution buddy 🙂

Anonymous
Not applicable

Hi @Irwan  I am handling zero manually now.. Your return code giving enexpected syntax error.

 

ashish_18_0-1721756284970.png

 

@Anonymous 

 

You are missing 1 line. Please check carefully first before asking.

Your DAX doesnt have this yellow highlight line.

Irwan_0-1721783720598.png

 

Thank you.

Anonymous
Not applicable

Thanks Irwan. It was not copied somehow during first chance. It worked now...thnx again!!

@Anonymous 

 

simple conditional if should do.

Runway by CF =
var _Sum =
SUMX(
    FILTER(
        'Table',
        'Table'[Index]>EARLIER('Table'[Index])
    ),
    'Table'[Current Forecast]
)
Return
IF(
    ISBLANK(_Sum),
    0,
    _Sum
)

Irwan_0-1721705189222.png

 

Thank you.

Anonymous
Not applicable

Hi @Anonymous ,

 

You can try formula like below to create measure:

Runway by CF = 
VAR CurrentMonth = MAX('Table'[Index])
VAR TotalForecast = CALCULATE(SUM('Table'[Current Forecast]), ALL('Table'))
VAR RollingTotal = 
    CALCULATE(
        SUM('Table'[Current Forecast]),
        FILTER(
            ALL('Table'),
            'Table'[Index] <= CurrentMonth
        )
    )
RETURN
    TotalForecast - RollingTotal + SUM('Table'[Current Forecast])

vkongfanfmsft_0-1721698353399.png

Best Regards,
Adamk Kong

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi AdamK,

 This solution doesnt serve the purpose your column Runway by CF is not coming to zero in end.

 

It should be like below

ashish_18_0-1721701860706.png

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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