Forum Discussion

jayala's avatar
jayala
Frequent Visitor
6 years ago
Solved

Fixed time range

Hi guys,

 

I have a dataset that I need to filter by a fixed windows range time of 12 months.

 

I tried using two slicers: one with the "After" option for the Start date and a second one using a Measure (StartDate + 365) but it does not work.

 

Do you know how to perform this kind of custom slicing?

 

Thank you in advance.

 

  • Hi jayala ,

    You just want to show the values for 12 months after the selected date. Right? If so, I think you could create a measure like below:

    Selected Date + 365 =
    CALCULATE (
        SUM ( 'Table'[ Sales] ),
        FILTER ( 'Table', 'Table'[Date] >= MIN ( 'Date'[Date] ) + 365 )
    )
    

    If you want to show the values which is between selected date and 12 months after that, please try this:

    selected date to Selected Date + 365 =
    CALCULATE (
        SUM ( 'Table'[ Sales] ),
        FILTER (
            'Table',
            'Table'[Date] >= MIN ( 'Date'[Date] )
                && 'Table'[Date]
                    <= MIN ( 'Date'[Date] ) + 365
        )
    )
    

     

    Best Regards,

    Xue Ding

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

3 Replies