The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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....
Solved! Go to Solution.
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 🙂
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.
Can you check if the DAX you are using is the same as one I posted last time ?
Now I am using the new code and I see no issues.
HI @SachinNandanwar its working with earlier code itself.
Do u have any idea how to get Runway by Burn rate
Index | Month | Sum of current cost | Runway by CC | Burn Rate | Runway by Burn Rate |
1 | Nov | 218228 | 2819358 | 253132.2 | 2819358 |
2 | Dec | 159400 | 2659958 | 218228 | 2566225.833 |
3 | Jan | 190645 | 2469313 | 190645 | 2347997.833 |
4 | Feb | 183136 | 2286177 | 183136 | 2157352.833 |
5 | Mar | 193967 | 2092210 | 193967 | 1974216.833 |
6 | Apr | 229776 | 1862434 | 229776 | 1780249.833 |
7 | May | 283923 | 1578511 | 283923 | 1550473.833 |
8 | Jun | 257771 | 1320740 | 257771 | 1266550.833 |
9 | Jul | 280560 | 1040180 | 253132.2 | 1008779.833 |
10 | Aug | 336528 | 703652 | 253132.2 | 755647.6667 |
11 | Sep | 337392 | 366260 | 253132.2 | 502515.5 |
12 | Oct | 366260 | 0 | 253132.2 | 249383.3333 |
Why are the burn rates for Nov same as July,Aug,Sep&Oct ?
because current month and future month should have average of all--as per requirement
Could you please mark the previous requirement solved ?
HI @SachinNandanwar I am using below column measure to calculate burn rate.
burnrate1 = IF('Table'[Index]-2>=[CurrentMonthNo],'Table'[Avg],'Table'[Current Cost])
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 ?
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.
hello @Anonymous
please check if this accomodate your need.
Runway by CF =
SUMX(
FILTER(
'Table',
'Table'[Index]>EARLIER('Table'[Index])
),
'Table'[Current Forecast]
)
Hope this will help you.
Thank you.
Hi @Irwan your result Runway by CF looks good to me but code is not working for me. Its giving me below error
@Anonymous
please use calculated column for that DAX (not measure).
I got same error if I use that DAX in measure.
Thank you
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
You are missing 1 line. Please check carefully first before asking.
Your DAX doesnt have this yellow highlight line.
Thank you.
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
)
Thank you.
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])
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.
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