Forum Discussion

dominikRieder's avatar
dominikRieder
Frequent Visitor
6 years ago
Solved

Filter Table with OR condition on different columns

Hello everyone,

 

I would like to filter a table on its Date-Values and on some Status-Values, e.g:

IDDateStatus
1Dec. 20191
2Jan. 20201
3Feb.20202
4Mar.20202
5Apr. 20203

The user should be able to select a Data-Range with a Slicer Visual and a selection of Multiple Status-Values from a list (maybe a Slicer Visual as well). The resulting Table should contain rows which are either in the data-range or have a status equal to one of the selected status-values

e.g: Date-Range Jan.2020 - Feb.2020 and Status-Values: 1,2 should return table with IDs: 1,2,3,4

 

What would be the best way to achieve that? Any hints are appreciated very much!

  • Hi dominikRieder ,

     

    Create a calendar table and a status table to use on your slicers now add the following measure to your data:

    Measure =
    IF (
        (
            SELECTEDVALUE ( 'Table'[Date] ) <= MAX ( 'Calendar'[Date] )
                && SELECTEDVALUE ( 'Table'[Date] ) >= MIN ( 'Calendar'[Date] )
        )
            || SELECTEDVALUE ( 'Table'[Status] ) IN VALUES ( 'Status'[Status] );
        1;
        BLANK ()
    )
    

     

    Now filter you information based on the value 1 of the measure check the PBIX file attach.

     

     

4 Replies

  • Hi dominikRieder ,

     

    Create a calendar table and a status table to use on your slicers now add the following measure to your data:

    Measure =
    IF (
        (
            SELECTEDVALUE ( 'Table'[Date] ) <= MAX ( 'Calendar'[Date] )
                && SELECTEDVALUE ( 'Table'[Date] ) >= MIN ( 'Calendar'[Date] )
        )
            || SELECTEDVALUE ( 'Table'[Status] ) IN VALUES ( 'Status'[Status] );
        1;
        BLANK ()
    )
    

     

    Now filter you information based on the value 1 of the measure check the PBIX file attach.

     

     

    • dominikRieder's avatar
      dominikRieder
      Frequent Visitor

      Hi MFelix, thank you for the quick reply. I will try that out and let you know whether it worked for me 

  • dominikRieder , Not sure I got it.

    If you simply put them in a table visual and put slicer it should do

     

    If needed add a measure count(Table[ID]) along with other .

    • MFelix's avatar
      MFelix
      Super User

      Hi  amitchandak ,

       

      I also add to read the post twice the trick is that dominikRieder  want one option or the other using slicers from the table he will get the AND not OR.

       

      😀