Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Sum up amount before selected slicer date

 Hi PB Buddies, 

 

I would like to have a measure, it would sum up the amount before the selected start date with date slicer changing, 
For example, when the date slicer selected 5 Jan to 9 Jan, the result is 4+5+3+10 = 22

 

When the date slicer selected 3 Jan to 9 Jan, the result is 4+5 = 9

 

Many many thanks!

  • Hi Anonymous ,

     

    At first, you need to create a new date dimention as a slicer.

    Then refer to the following measure.

    Measure =
    VAR a =
        CALCULATE ( MIN ( 'Table 2'[Date] ), ALLSELECTED ( 'Table 2'[Date] ) )
    RETURN
        CALCULATE ( SUM ( 'Table'[Amount] ), FILTER ( 'Table', 'Table'[Date] < a ) )

    Here is the result.

    Here is my test file for your reference.

     

5 Replies