Forum Discussion

gregomex's avatar
gregomex
New Member
3 years ago

Delete explicit filter and apply new filter (date)

Hello everyone,

 

I have a model made up of a table of dates starting in 2020. It's associated with a fact table from which I've created measures (e.g. sales sums).

The visualization I'm using contains slicers (explicit filters) that filter the year and month of my date dimension table (e.g. June 2023).

 

I'd like to modify the context to apply a date filter starting in 2021, i.e. display the sum of sales since 01/01/2021.

The ALL function retrieves all dates since 2020, but I can't create the second step, which is to apply the 2nd filter to sum sales from 2021 to today. SalesSince2021 = calculate(sales, all(dates), .....?)

 

Thanks for your help!

 

3 Replies

  • Hi gregomex ,

    You can try something like this

    Salessince2021 = CALCULATE(Sales, FILTER('Table', 'Table'[Date] > DATE(2021,01,01)))

     

    Regards,

    • gregomex's avatar
      gregomex
      New Member

      Thank you Thejeswar.

      However, Explicit filters (Slicers) do affect the calculation. So, applying filters as of June 2023 only give me results of this month, whereas I need Sales since 2021, whatever the slicers filters are. Thanks