Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

How can I add condition in Query using Mcode for multiple columns in one go?

Hi,

I would like to filter only 'Date' value from 2nd column OR(not AND) 'Inbound', 'Outbound', 'FAT Faulty', Progress' values from 4th column.

But thing is if I filter 2nd column with 'Date' then 4th values not visible.

 

Please help to filter either 'Date' or 'Inbound', 'Outbound', 'FAT Faulty', Progress'

 

 

 

 

  • Hello Anonymous , 

     

    You can use Power Query in Power BI to add a custom column with the following condition

     

    if [Custom.Data.Column2] = "Date" or [Custom.Data.Column4] in {"Inbound", "Outbound", "FAT Faulty", "Progress"} then "Keep" else null

     

    You can filter the data where this new column contains the value "Keep". This will allow you to filter for rows where either the second column contains "Date" or the fourth column contains any of the desired values.

     

    If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes 👍 are much appreciated!

     

    Thank You

    Dharmendar S

    LinkedIN 

2 Replies

  • dharmendars007's avatar
    dharmendars007
    Memorable Member

    Hello Anonymous , 

     

    You can use Power Query in Power BI to add a custom column with the following condition

     

    if [Custom.Data.Column2] = "Date" or [Custom.Data.Column4] in {"Inbound", "Outbound", "FAT Faulty", "Progress"} then "Keep" else null

     

    You can filter the data where this new column contains the value "Keep". This will allow you to filter for rows where either the second column contains "Date" or the fourth column contains any of the desired values.

     

    If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes 👍 are much appreciated!

     

    Thank You

    Dharmendar S

    LinkedIN 

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks it helps!