Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Incremental Measure

Hi All,   I want to create a measure where I want to show the incremental sum of the last 6 weeks.  For example the values for 05/18 and 05/25 should show just 1 ( 289-288) and rest should show 0 ...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi, Anonymous 

    I create a sample table:

     

    Then create a new measure and try the follow DAX expression:

     

     

    Incremental_Assessment = 
    VAR CurrentWeek = MAX('Table'[Date])
    VAR PreviousWeek = CALCULATE(MAX('Table'[Date]), DATEADD('Table'[Date], -7, DAY))
    VAR CurrentWeekSum = CALCULATE(SUM('Table'[Total Assessments]), 'Table'[Date] = CurrentWeek)
    VAR PreviousWeekSum = CALCULATE(SUM('Table'[Total Assessments]), 'Table'[Date] = PreviousWeek)
    RETURN
    IF(CurrentWeekSum > PreviousWeekSum, CurrentWeekSum - PreviousWeekSum, 0)
    

     

     

     

    Here is my preview:

     

    If you want to show the last 6 weeks, you can use the filter or slicer to filter it.

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data)

     

    How to Get Your Question Answered Quickly 

    Best Regards

    Yongkang Hua

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.