Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Use Same Filter for Multiple Columns

Hi,

 

I was wondering if there was a way to create a slicer for the same month and day, but used for different columns in a table.

In my table, there are two different dates. One for Inititated Month and Day and another for Repaired Month and Day

 

I am trying to create one single dashboard so that when using a slicer filter for a specific Month and Day, it filteres for both the Initiated and Repaired dates. I have not found a solution so I have created two separate slicer filters for Initiated and Repaired, but I feel like there is a better way to do this. 

 

 

Thank you!
Sarah

12 Replies

  • v-lid-msft's avatar
    v-lid-msft
    Community Support

    Hi Anonymous ,

     

    First of all, we can create a spreated calculated table as te slicer

     

    Slicer = DISTINCT(UNION(DISTINCT('Table'[Init Month and Day]),DISTINCT('Table'[Repaire Month and Day])))

     

    Then we can create a measure and use it in visual filter to meet your requirement:

     

    Filter In Date =
    CALCULATE (
        COUNTROWS ( 'Table' ),
        FILTER (
            'Table',
            [Init Month and Day] IN FILTERS ( Slicer[Month and Day] )
                || [Repaire Month and Day] IN FILTERS ( 'Slicer'[Month and Day] )
        )
    )

     


    If it doesn't meet your requirement, Please show the exact expected result based on the Tables that we have shared.


    Best regards,

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Good Morning Dong ,

       

      I have created the Slicer table as you showed:

      Slicer = DISTINCT(UNION(DISTINCT(Query1[Init Month and Day]),DISTINCT(Query1[Repaired Month and Day]))), named Month and Day, and also the measure named Filter in Data: 
      Filter in Data = CALCULATE(COUNTROWS(Query1),FILTER(Query1, Query1[Init Month and Day] IN FILTERS (Slicer[Month and Day]) || Query1[Repaired Month and Day] IN FILTERS (Slicer[Month and Day])))
       

      I am struggling understanding how to use this filter, because I believe that there is no link between the above column and measure and the table 'Query 1' , so when using Month and Day as the field for the Slicer filter, it does not filter the tables as seen in the screenshot below...

       

      Thank you so much!
      Sarah 

      • mwegener's avatar
        mwegener
        Most Valuable Professional

        Hi Anonymous ,

         

        could you share a screenshot of your model view?

        Is there only one Measure in your Matrix?

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hello everyone, 

    I am creating a dashboard and my dataset has 4 slicers to filter the data.

    SubjectsRank1Rank2Rank3Rank4
    EnglishJohnClaraReyRey
    MathsPeterRoyNoah 
    ScienceMarkJezzJezzPeyer

     

    Currently , i have 4 filters for Rank1, Ran2, Rank3, Rank4.. My intention is to combine all 4 filters to one filter name student name and then when i filter any name in the slicer , whole dashboard chnages to it.

     

    Many thanks in advance