Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Query Filter rule with 3 or´s problem

Good afternoon,

 

So i have a query where i have 8 columns that from those i want to filter the results of 3.

 

So i have the rule: = Table.SelectRows(#"Expanded 4", each [C001] = 1 or [C009] = 1 or [C018] = 1)

 

My problem it´s that in some reports from each month one or more of this 3 columns in the filter maybe not appear. And when i refresh it says that the column wasn´t found.

 

So my question it´s: can i have this rule and if power bi doesn´t find one of this columns ignore and pass to the other?

 

Best regards

Ricardo Silva

  • Anonymous 

     

    Try with following

     

    = Table.SelectRows(#"Expanded 4", each 
    (try [C001] = 1 otherwise false) or
     (try [C009] = 1 otherwise false) or 
    (try [C018] = 1 otherwise false)
    )

2 Replies

  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    Community Champion

    Anonymous 

     

    Try with following

     

    = Table.SelectRows(#"Expanded 4", each 
    (try [C001] = 1 otherwise false) or
     (try [C009] = 1 otherwise false) or 
    (try [C018] = 1 otherwise false)
    )
    • Anonymous's avatar
      Anonymous
      Not applicable

      Good afternoon Zubair,

       

      It works perfectly. Thank you so much for you help.