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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
RENJITH_R_S
Resolver II
Resolver II

Reverse Running Total for Forecast with condition - Dax Help

Hello friends,
can you help me to get a dax formula to get reverse running total of forecast

see my sample data
Gap = Planned - Actuals

how reverse running total is calculated is

if acutals for current month is present
then it took Reverse Running Total planned - Actuals + Gap, Here 27-1+1 = 27

if Actuals is not present the prev month RRT forecast- current month planned
example in jun no actuals the may forecast value - june planned value , 27 - 3 = 24


MonthPlannedReverse Running Total plannedActualsGapReverse Running Total Forecast
May-24      2            27    1  127
Jun-24       3              25  24
Jul-24        4             22  20
Aug-24        5             18  15
Sep-24     6              13  9
Oct-24      7                 7  2
Total     27    
1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@RENJITH_R_S Try:

Column = 
    VAR __Month = [Month]
    VAR __Actuals = SUMX( FILTER( 'Table', [Month] <= __Month && [Actuals] <> BLANK() ), [Actuals] )
    VAR __Gap = SUMX( FILTER( 'Table', [Month] <= __Month && [Actuals] <> BLANK() ), [Gap] )
    VAR __Planned = SUMX( FILTER( 'Table', [Month] <= __Month && [Actuals] = BLANK() ), [Planned] )
    VAR __MinMonth = MINX( 'Table', [Month])
    VAR __Start = SUMX( FILTER( 'Table', [Month] = __MinMonth ), [Reverse Running Total planned] )
    VAR __Result = __Start - __Actuals + __Gap - __Planned
RETURN
    __Result


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@RENJITH_R_S Try:

Column = 
    VAR __Month = [Month]
    VAR __Actuals = SUMX( FILTER( 'Table', [Month] <= __Month && [Actuals] <> BLANK() ), [Actuals] )
    VAR __Gap = SUMX( FILTER( 'Table', [Month] <= __Month && [Actuals] <> BLANK() ), [Gap] )
    VAR __Planned = SUMX( FILTER( 'Table', [Month] <= __Month && [Actuals] = BLANK() ), [Planned] )
    VAR __MinMonth = MINX( 'Table', [Month])
    VAR __Start = SUMX( FILTER( 'Table', [Month] = __MinMonth ), [Reverse Running Total planned] )
    VAR __Result = __Start - __Actuals + __Gap - __Planned
RETURN
    __Result


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thanks @Greg_Deckler 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors