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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Cumulative running total not starting from zero

I am plotting a cummulative graph from Budgted table to calendar date table using quick measure;

 

Budgted direct cost is in one table and Calendar is other table.

 

BudgetedDirectCost running total in Date =

CALCULATE(

    SUM('Tasks'[BudgetedDirectCost]),

    FILTER(

        ALLSELECTED('Calendar'[Date]),

        ISONORAFTER('Calendar'[Date], MAX('Calendar'[Date]), DESC)

    )

)

 

 
I even changed it to this,
BudgetedDirectCost running total in Date =

CALCULATE(

    SUM('Tasks'[BudgetedDirectCost]),

    FILTER(

        ALLSELECTED('Calendar'[Date]),

        ('Calendar'[Date] <= MAX('Calendar'[Date]))

    )

)

 
image 2.png
 
There is an already existing post on same topic but it did not help.
1 ACCEPTED SOLUTION
v-eachen-msft
Community Support
Community Support

Hi @Anonymous ,

 

You could use calculated column to get zero result.

Cumulative = 
IF('Table'[Date]>MIN('Table'[Date]),
CALCULATE(
    SUM('Table'[Value]),
    FILTER('Table','Table'[Date]<=EARLIER('Table'[Date]))
)+0,0)

Here is the result. The value of first date is 0 but not the correct value.

1-1.PNG

 

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

View solution in original post

4 REPLIES 4
v-eachen-msft
Community Support
Community Support

Hi @Anonymous ,

 

You could use calculated column to get zero result.

Cumulative = 
IF('Table'[Date]>MIN('Table'[Date]),
CALCULATE(
    SUM('Table'[Value]),
    FILTER('Table','Table'[Date]<=EARLIER('Table'[Date]))
)+0,0)

Here is the result. The value of first date is 0 but not the correct value.

1-1.PNG

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
Anonymous
Not applicable

Hi @Anonymous ,

Add Zero to your measure and the X-axis should be from dimension table. Find the below measure and screenshot FYR.

Measure:

Running Total = CALCULATE(
SUM('Sample'[Sales ]),
FILTER(ALL('Date_Dim'),'Date_Dim'[Date]<=MAX(Date_Dim[Date]))
)+0

Output:
Capture.PNG
Best Regards,
Mail2inba4

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

 I cant use the Dim table for X axis as I have to make graphs from diffretent tables. But looks like I have to put zero in my data

JarroVGIT
Resident Rockstar
Resident Rockstar

Well, cumulative means it starts adding, if your first date has a value, this will be the starting point of your graph? Why are you expecting it would start at zero?
Potentially you could add a zero value in your dataset?

If this answered your question, please mark it as the solution. Kudos are welcome:)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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