Forum Discussion

dsalony's avatar
dsalony
Icon for Helper I rankHelper I
4 years ago
Solved

Create moving range of dates with DAX

I have a dates table.  I want to set up a slicer on the dates, allowing a user to define an end-date.  From that I want to create a set period of indexed dates tied to that variable date that can be ...
  • Jihwan_Kim's avatar
    4 years ago

    Hi,

    Please check the below picture and the attached pbix file.

     

     

    Index measure: =
    IF (
        MAX ( Data[Date] ) <= MAX ( Slicer[Date] )
            && MAX ( Data[Date] )
                >= MAX ( Slicer[Date] ) - 7,
        1,
        0
    )