Forum Discussion

WalkerGBG's avatar
WalkerGBG
Frequent Visitor
5 years ago
Solved

Cumulative Column based on month and Feature

Hi

 

Very new still to PowerBI and Dax.  I've been searching for a few days to work out how to get a Running Total (Cumulative) added to my data after loading

Example below

What I'm hoping you can see (highlghted below) is that I want to get a total figure on each tow for the Impact Time in the month for each feature (in this example Feature "1" has 4 issues and is affected for 5, 7, 13, 19 minutes - totalling 44; Feature "2" has 2 issues and is affected for 1, 35 minutes - Totalling 36) 

 

MonthFeatureImpactTimeRunning Total
Jan-201544
Jan-2021212
Jan-203136
Jan-201744
Jan-2011344
Jan-2042020
Jan-2033536
Jan-2011944
Feb-2011080
Feb-2012780
Feb-2014380

 

It's probably very easy to do but I'm not able to understand from the other suggestions in the forum how to apply it so need to specifically ask for my scenario

 

Thanks in advance

  • Hi,

    This calculated column formula works as well

    Running total = CALCULATE(SUM(Data[ImpactTime]),FILTER(Data,Data[Month]=EARLIER(Data[Month])&&Data[Feature]=EARLIER(Data[Feature])))

    Hope this helps.

3 Replies

  • vanessafvg's avatar
    vanessafvg
    Community Champion
    you can give this a try.  you will need to create a date table if you dont have one
     
    ie 
    date = calendarauto () (paste that into a new table)
     
    for the new measure
    running_total =
    var mxdt = max('date'[Date])
    var fstdt = min('date'[Date])
    var lst = CALCULATE(max(cummulativetotal[Month]), REMOVEFILTERS())
    var result = if(fstdt <= lst, CALCULATE(sum(cummulativetotal[ImpactTime]), 'date'[Date] <= lst)) return result
  • WalkerGBG 

    maybe you can try to create a column

    Column = CALCULATE(sum('Table'[ImpactTime]),ALLEXCEPT('Table','Table'[Month],'Table'[Feature]))

  • Hi,

    This calculated column formula works as well

    Running total = CALCULATE(SUM(Data[ImpactTime]),FILTER(Data,Data[Month]=EARLIER(Data[Month])&&Data[Feature]=EARLIER(Data[Feature])))

    Hope this helps.