Forum Discussion

kristi_in_heels's avatar
2 years ago
Solved

Help with Cumulative Totals

Hello,   I have a set of data which I am trying to show in a line graph visual. I want to be able to show 2 separate lines: - Value per month - Cumulative Value which obviously increases per mont...
  • isjoycewang's avatar
    isjoycewang
    2 years ago

    Hi kristi_in_heels,

     

    Exercise File

    Since you're using inactive relationship between 'Calendar' and 'Table', please modify the measures as below:

     

    Forecast Value = 
    CALCULATE( 
        SUM('Table'[Baseline Forecast]), 
        USERELATIONSHIP('Calendar'[Date], 'Table'[Date]))
    Cumulative Value = 
    var maxdate= MAX('Calendar'[Date])
    return
    CALCULATE( 
        SUM('Table'[Baseline Forecast]), 
        FILTER(
            ALL('Calendar'), 
            'Calendar'[Date] <= maxdate), 
        USERELATIONSHIP('Calendar'[Date], 'Table'[Date]))