Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Set different behavior for the same slicer filter

I have informations from two different tables combined on the same visual table using measures.

I'm using a slicer to filter informations from both original tables based on a date column.

What I did to get the filter working was to create a third table with a date column and create a relationship between this date column with date column from the other two tables.

The filter is working well, filtering start and end date from both tables.

My problem is that for the first table I need to filter just the end date, so I get cumulative value from column "Information". And for the second table I need to filter all the period (start and end date).

Example:

Table 1: Need to filter just the end date

Date              Information   Category   
11/10/20221a
11/12/20222a
11/14/20223a
11/15/20224a

Table 2: Need to filter both start and end date

Date              Information   Category   
11/12/20221a
11/14/20222a
11/15/20223a
11/16/20224a

Supposing I have a count and a sum measure for Information column, on the visual table I should get the below, if I set this period on the slicer filter: 11/14/2022 to 11/15/2022

Category   Count of Information   Sum of Information   
a511

Basically, for Table 1 the period should be 11/10/2022 to 11/15/2022 and for Table 2 should be 11/14/2022 to 11/15/2022.

Is that possible using the same slicer filter?

Thank you!

 

2 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you so much AllisonKennedy !!

      I didn't think about using filtered data from slicer on the measures.

      Basically I've created my measures (sum and count) without date filter for the Table 2 (so it was filtered directly by slicer filter) and with filter for Table 1. Then created a relationship between date column of Table 2 table and date column of my Date Table. Also I've deleted Table 1 date column relationship with Date Table so it was filtered by the measure.

       

      For those who need a hint:

      Step 1:

      CALCULATE(
      SUM('Table1'[Information]) + SUM('Table2'[Information]), FILTER('Table2', 'Table2'[Date Column] <= MAX(['Date Table'[Date Column]]))
      Step 2: Create a relation between "Table 1" date column and "Date Table" date column.
      Step 3: Delete any relation between "Table 2" and "Date Table", otherwise your filter won't work.