Forum Discussion

KH11NDR's avatar
KH11NDR
Icon for Helper IV rankHelper IV
8 years ago
Solved

Running total, by Project ID column

Hi Guys

 

I Need the running totals each month in a column for the Days column grouped by Project ID.

 

Thanks Guys

 

Project IDDaysDateRunning Total Days
AA1601/01/201816
AA2001/02/201836
AA2001/03/201856
AA2001/04/201876
BB101/01/20181
BB101/02/20182
BB601/03/20188
BB701/04/201815
  • they do work for me - is the Table[Date] of data type Date? Other than that I cannot think of other reason for it not to work

10 Replies

  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    Icon for Community Champion rankCommunity Champion

    KH11NDR

     

    Column =
    CALCULATE (
        SUM ( [Days] ),
        FILTER (
            ALLEXCEPT ( Table1, Table1[Project ID] ),
            [Date] <= EARLIER ( [Date] )
        )
    )
    • KH11NDR's avatar
      KH11NDR
      Icon for Helper IV rankHelper IV

      No that never worked, That's what I tried myself first.

  • Stachu's avatar
    Stachu
    Icon for Community Champion rankCommunity Champion

    syntax for calculated column

    Running Total Days = 
    VAR Project = 'Table'[Project ID]
    VAR CurrentDate = 'Table'[Date]
    RETURN
    CALCULATE(SUM('Table'[Days]),FILTER('Table','Table'[Project ID]=Project &&'Table'[Date]<=CurrentDate))

    syntax for a measure - summary for a project gives the sum for the latest date for that project

    Running Total Days Measure = 
    VAR Project = SELECTEDVALUE('Table'[Project ID])
    VAR CurrentDate = MAX('Table'[Date])
    RETURN
    CALCULATE(SUM('Table'[Days]),'Table'[Project ID]=Project,'Table'[Date]<=CurrentDate)
    • KH11NDR's avatar
      KH11NDR
      Icon for Helper IV rankHelper IV

      Stachu.

       

      None of those worked, In the measure, it gives me the same days as they are in each month, no rolling totals.

      • Stachu's avatar
        Stachu
        Icon for Community Champion rankCommunity Champion

        they do work for me - is the Table[Date] of data type Date? Other than that I cannot think of other reason for it not to work