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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
DivakarKrishnan
Helper II
Helper II

Running Totals are not considering the values from IF DAX.

Dear Team,

I am calculating cumulative balance using DAX, my DAX is not giving correct running totals.

Issue is happening due to this “Funding” measure part, if I ignore / comment out this Funding measure then my running totals are coming correctly. So basically my cumulative DAX is not considering this “Funding” measure. Please advise on how to correct this one? Tried many workarounds but none of them is working for my case.

 

DAX 1

Balance Current Month Updated =

[TB Amount Total] + [ToCollect] - [Forecasted payments v2] + [Funding]

 

DAX 2

Funding = IF(

[Balance Current Month] < 0,      

[Balance Current Month]*-1,10000000

)

 

DAX 3

Cumulative Balance Updated =

VAR Result =

 

        CALCULATE (

            [Balance Current Month Updated],

            FILTER ( ALLSELECTED ( 'Date' ), 'Date'[Date] <= MAX('Date'[Date] )

            )

    )

RETURN

    Result

1 ACCEPTED SOLUTION

@DivakarKrishnan , Your questions seem the same as this one? https://community.powerbi.com/t5/DAX-Commands-and-Tips/Cumulative-Balance-Issue/m-p/1382270#M25265

Check the suggestion there

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Not enough information to tell you where a problem is....
amitchandak
Super User
Super User

@DivakarKrishnan , Try like

 

Cumulative Balance Updated =

VAR Result =
var _1 = Sumx(summarize('Date', 'Date'[Month Year],"_1",[Balance Current Month Updated]),[_1])
return
CALCULATE (
_1, FILTER ( ALLSELECTED ( 'Date' ), 'Date'[Date] <= MAX('Date'[Date] )
) )

or
Cumulative Balance Updated =

VAR Result =
var _1 = Sumx(summarize('Date', 'Date'[Date],"_1",[Balance Current Month Updated]),[_1])
return
CALCULATE (
_1, FILTER ( ALLSELECTED ( 'Date' ), 'Date'[Date] <= MAX('Date'[Date] )
) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Dear Amit @amitchandak , Tried the both but not working.. 

 

When using Month Year, i am getting same figures as Balance Current Month Updated.

 

When using Date, i am getting below which is not correct and huge figures.

 

PBi Issue.png

@DivakarKrishnan , Your questions seem the same as this one? https://community.powerbi.com/t5/DAX-Commands-and-Tips/Cumulative-Balance-Issue/m-p/1382270#M25265

Check the suggestion there

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.