Forum Discussion

llavey's avatar
llavey
Regular Visitor
10 years ago

Cumulative Total DAX

Row LabelsSum of Ext QtyCumulative Extr Qty FailsSum of DELIVERY_QTY_EXPExtr DPMCumulative Extr DPM
2015-11224223.7605022222,282,7871.01.0
2015-12315539.1262961174,694,9471.81.4
2016-01262801.1768099177,758,6551.51.4
2016-02103903.8266581211,934,8930.51.1
2016-033906.8266581197,277,2940.00.9
2016-045911.3928682197,876,4620.00.8
2016-0500158,747,5080.00.0
Grand Total911911.39286821,340,572,5460.70.7

When the Sum of Ext Qty = 0, then i want the Cumulative Extr Qty Fails to add that 0 and always show a Cumulative total.  But it doesn't, it just shows 0.  How do i modify my formula to always show running total, even if Sum of Ext Qty = 0?

 

My DAX formula:

Cumulative Extr Qty Fails:=calculate(if(sum('A'[Extrapolated Qty])=BLANK(),0,sum ('A'[Extrapolated Qty])),FILTER(ALLSELECTED ('A'),A[Year-Month]<=MAX ('A'[Year-Month])))

11 Replies

  • Sean's avatar
    Sean
    Community Champion

    llavey Is this a trick question?

     

    Get rid of the condition...

    Cumulative Extr Qty Fails :=
    CALCULATE (
        SUM ( 'A'[Extrapolated Qty] ),
        FILTER ( ALLSELECTED ( 'A' ), A[Year-Month] <= MAX ( 'A'[Year-Month] ) )
    )
    • llavey's avatar
      llavey
      Regular Visitor

      Why would i get rid of this?  I need it for the Cumulative DPM for each month?

  • Sean's avatar
    Sean
    Community Champion

     How do i modify my formula to always show running total, even if Sum of Ext Qty = 0?

     

    My DAX formula:

    Cumulative Extr Qty Fails:=calculate(if(sum('A'[Extrapolated Qty])=BLANK(),0,sum ('A'[Extrapolated Qty])),FILTER(ALLSELECTED ('A'),A[Year-Month]<=MAX ('A'[Year-Month])))


     llavey I believe i answered your original Question...

     

    And no I did not create any new columns.

    All I did was change the MEASURE formula....