Forum Discussion

tiny's avatar
tiny
Frequent Visitor
2 years ago
Solved

Filter table dynamically based on multiple selections from a Slicer

Hello,

I'm trying to filter table dynamically based on multiple selections from a Slicer. Here is an example, I have a date table and is used as slicer, the slicer is with a hierarchy  (Year->Month->Day) and mutiple selections, here is the date table:

We have another table sales: it only has data for year/month, not date, but the slicer can select date because other table is also using it

Now what we need to do is that:

User can select multiple dates from the slicer, for example, they can select 2023/10/1 and 2023/9, we need to calculate dynamicly based on the selections on Sales table for the total sales, the results should look like this:

Could we do it using DAX? 

Thank you very much for your help!

 

 

 

  • CALCULATE(SUM(Sales[Sales]),TREATAS(VALUES(DateTable[Date YM]),Sales[Date YM]))

2 Replies

  • wdx223_Daniel's avatar
    wdx223_Daniel
    Community Champion

    CALCULATE(SUM(Sales[Sales]),TREATAS(VALUES(DateTable[Date YM]),Sales[Date YM]))

  • tiny's avatar
    tiny
    Frequent Visitor

    Perfect! Works great 🙂 Thank you very much! Really appreciated!