Forum Discussion

ReadTheIron's avatar
ReadTheIron
Icon for Helper III rankHelper III
5 years ago
Solved

Multiple Filters with OR

My data looks something like this:

I want to create a visual showing all upcoming inspections that would look something like this:

I want to display only the upcoming dates. If an asset has an upcoming date in one group and a past date in another, I want to display the asset, but I don't want to display the past date.

 

After some googling, I tried creating tables for the unique values in each column and then writing a measure that assigned a 1 or a 0 based on whether the selected value appeared in any of the columns of the original table, but this didn't work. (And I didn't even get into how to write a relative date in DAX, though I could probably find info on that easily enough if I could get my other conditions working)

 

Still quite new to this; any help appreciated!

 

  • ReadTheIron I think the easiest way to do it would be to have a measure that checks each group inspection column and returns the date it is > TODAY().

     

    A Inspection = 
    VAR _Inspection = SELECTEDVALUE ('Table'[A Group Inspection] )
    RETURN 
    IF ( _Inspection > TODAY(), _Inspection )
    B Inspection = 
    VAR _Inspection = SELECTEDVALUE ('Table'[B Group Inspection] )
    RETURN 
    IF ( _Inspection > TODAY(), _Inspection )
    C Inspection = 
    VAR _Inspection = SELECTEDVALUE ('Table'[C Group Inspection] )
    RETURN 
    IF ( _Inspection > TODAY(), _Inspection  )

     

2 Replies

  • ReadTheIron I think the easiest way to do it would be to have a measure that checks each group inspection column and returns the date it is > TODAY().

     

    A Inspection = 
    VAR _Inspection = SELECTEDVALUE ('Table'[A Group Inspection] )
    RETURN 
    IF ( _Inspection > TODAY(), _Inspection )
    B Inspection = 
    VAR _Inspection = SELECTEDVALUE ('Table'[B Group Inspection] )
    RETURN 
    IF ( _Inspection > TODAY(), _Inspection )
    C Inspection = 
    VAR _Inspection = SELECTEDVALUE ('Table'[C Group Inspection] )
    RETURN 
    IF ( _Inspection > TODAY(), _Inspection  )

     

    • ReadTheIron's avatar
      ReadTheIron
      Icon for Helper III rankHelper III

      That worked beautifully! Thank you so much - this will be very helpful.