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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
abusen
Regular 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
v-piga-msft
Resident Rockstar
Resident Rockstar

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.

View solution in original post

3 REPLIES 3
v-piga-msft
Resident Rockstar
Resident Rockstar

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.
Johanno
Responsive Resident
Responsive Resident

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.

Can you explain more please

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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