Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
I have table called prodcut table. I want to filter the table on the basis of conditions in dfferenet colunmn. For the same record in one column one condition and in another column another condition.My first condition is in [Product_ID] column and another condition is in [Pain Attribute 5] column.But when I am using filtering on the bsis of this condition MCode is appliying only the first condition .This means if the are two records with same Product_ID but with different Pain Attribute 5 , These two records are getting delted in the filter .My M code looks like this :
#"Filtered Rows1" = Table.SelectRows(#"Renamed Columns2", each [Product_ID] <> "311789" and [#"Pain Attribute 5"] <> "Not Found"),
I want remove the [Product_ID] = "311789" and [Pain Attribute 5] ="Not Found"
But my code remove all [Product_ID] with "311789" without considering my second conditon [Pain Attribute 5] ="Not Found"
I need help to get the correct filter Mcode.
Solved! Go to Solution.
The easiest way is to deselect the values you wish to exclude in the dropdown in each of the relevant column headers filters.
If you want to exclude rows where both conditions are met, you can create a new conditional column to create a flag and then filter rows by the flag. You then delete the flag column as the last step.
To create the Conditional Column you can use something along the lines of:
#"FlaggedRows" = Table.AddColumn(#"Renamed Columns2", "FlaggedRows", each if [Product_ID] <> "311789" and [#"Pain Attribute 5"] <> "Not Found" then "Flag" else null),
This will create a new column with "Flag" for rows where both conditions are not met. You can then filter the column for "Flag" and delete the FlaggedRows column as the last step.
Proud to be a Super User!
Paul on Linkedin.
The easiest way is to deselect the values you wish to exclude in the dropdown in each of the relevant column headers filters.
If you want to exclude rows where both conditions are met, you can create a new conditional column to create a flag and then filter rows by the flag. You then delete the flag column as the last step.
To create the Conditional Column you can use something along the lines of:
#"FlaggedRows" = Table.AddColumn(#"Renamed Columns2", "FlaggedRows", each if [Product_ID] <> "311789" and [#"Pain Attribute 5"] <> "Not Found" then "Flag" else null),
This will create a new column with "Flag" for rows where both conditions are not met. You can then filter the column for "Flag" and delete the FlaggedRows column as the last step.
Proud to be a Super User!
Paul on Linkedin.