Forum Discussion

Jidnyasa2904's avatar
Jidnyasa2904
Icon for Helper I rankHelper I
1 year ago
Solved

Dynamic date range slicer with only the max date (end date) selected and ignoring the min date

I have multiple filters that work well for Sales data, but when I need to display Inventory information, I want the filters to work slightly differently. The filters in place are: Time Shift Filte...
  • Jidnyasa2904's avatar
    1 year ago

    This worked for me: 

    ABC =

         VAR enddate = CALCULATE(

         MAX('Table'[Date]),

         FILTER('Table', 'Table'[Year] = SELECTEDVALUE('Max Year'[Year]))

    )

    RETURN

    CALCULATE(

         SUM('Table'[Cost]),

         'Table'[Date] <= enddate,

         REMOVEFILTERS('Time Shift Table'),     -- Remove all the tables which affect the date

         REMOVEFILTERS('Table')       -- In my case I had a Time shift table and a Date Table

    )


    Thanks!