cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
abusen Frequent Visitor
Frequent Visitor

DAX Cumulative Totals not equal zero for associated fields

Help please ,Im using this formula :

 

Cumulative Acutal =
CALCULATE (
    SUM ( 'Cashflow'[Actual(AED)] ),
    ALL ( 'Cashflow'),
    'Cashflow'[Date] <= EARLIER ( 'Cashflow'[Date] ))

Zero.png

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: DAX Cumulative Totals not equal zero for associated fields

Hi @abusen,

 

Please try the formula below.

 

Column =
VAR temp =
    CALCULATE (
        SUM ( Table1[Sales] ),
        FILTER ( ALL ( Table1 ), 'Table1'[Date] <= EARLIER ( Table1[Date] ) )
    )
RETURN
    IF ( ISBLANK ( 'Table1'[Sales] ), 0, temp )

Here is the output.

 

Capture.PNG

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 REPLIES 3
Johanno Member
Member

Re: DAX Cumulative Totals not equal zero for associated fields

Hi, I don't have the same names as you but if I have:

TOTALYTD(SUM(Resultattransaktioner[Belopp justerat]);Datumkoppling[Datum])

I get all months.

 

But if I add a filter with DATESBETWEEN as in:

CALCULATE(TOTALYTD(SUM(Resultattransaktioner[Belopp justerat]);Datumkoppling[Datum]);DATESBETWEEN(Datumkoppling[Datum];MIN(Resultattransaktioner[Bokf datum]);MAX(Resultattransaktioner[Bokf datum])))

then I show only the months where Actual(AED) has value, the rest are zero. I have though a separate date table.

abusen Frequent Visitor
Frequent Visitor

Re: DAX Cumulative Totals not equal zero for associated fields

Can you explain more please

Community Support Team
Community Support Team

Re: DAX Cumulative Totals not equal zero for associated fields

Hi @abusen,

 

Please try the formula below.

 

Column =
VAR temp =
    CALCULATE (
        SUM ( Table1[Sales] ),
        FILTER ( ALL ( Table1 ), 'Table1'[Date] <= EARLIER ( Table1[Date] ) )
    )
RETURN
    IF ( ISBLANK ( 'Table1'[Sales] ), 0, temp )

Here is the output.

 

Capture.PNG

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.