Forum Discussion

chreds's avatar
chreds
Regular Visitor
10 years ago
Solved

DAX - Running Total YTD

I'm trying to calculate a running total YTD and am having trouble getting it to work. Here's my table:   Month Recurring Cumulative Expected 2016-01-01 0:00 0 0 0 2016-02-01 0:00 5 5 5 2016-03...
  • konstantinos's avatar
    konstantinos
    10 years ago

    chreds The relationship is needed for measure and time intelligence. 

     

    Yes you can create as a calculated column. You calculate the sum of all the previous rows/dates

     

     

    Cumulative = 
    VAR RowDate = Table1[Date]
    RETURN
        CALCULATE (
            SUM ( Table1[Recurring] );
            FILTER (
                Table1;
                Table1[Date] <= RowDate
                    && YEAR ( Table1[Date] ) = YEAR ( RowDate )
            )
        )

    You can use or delete 

     && YEAR ( Table1[Date] ) = YEAR ( RowDate )

    if you need YTD or Cumulative Life to date