Forum Discussion

Abhaykumar's avatar
Abhaykumar
Microsoft Employee
8 years ago
Solved

Sum over specific range

I have a table Jobs:                             And another table DaySeries (for X-Axis):                                   There is many to one relation...
  • v-ljerr-msft's avatar
    8 years ago

    Hi Abhaykumar,

     

    Based on my test, you should be able to use the formula below to create a measure to get the total number jobs in previous 10 days (including that day) in your scenario. :smileyhappy:

    Measure =
    VAR currentDay =
        MAX ( DaySeries[Days] )
    RETURN
        CALCULATE (
            SUM ( Jobs[Jobs] ),
            FILTER (
                ALL ( DaySeries ),
                DaySeries[Days]
                    > currentDay - 10
                    && DaySeries[Days] <= currentDay
            )
        )
    

     

    Regards