Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
jorgeran5
New Member

Hello, How can I filter multiple colums in M code?

Hello,

 

I want to filter in my query  the rows that in my Column "GENDER" are males Male, except the ones in Column "Name" are equal to John.

 

Can you please tell me how I can do this in query editor using M language?

 

Many thanks,

Jorgeran5

2 ACCEPTED SOLUTIONS
camargos88
Community Champion
Community Champion

@jorgeran5 ,

 

Something like:

 

Table.SelectRows(STEP_NAME, each NAME <> "John")

 

or you can use the UI to filter directly by the NAME column.

 

Ricardo



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



View solution in original post

dax
Community Support
Community Support

Hi @jorgeran5 , 

You could try to refer to @camargos88 's suggestions to filter [GENDER] and [Name] directly. Or you also could create a column like below   if [GENDER] ="male" and [Name]<>"John" then "1" else null, then filter this column which value not equal null.

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
dax
Community Support
Community Support

Hi @jorgeran5 , 

You could try to refer to @camargos88 's suggestions to filter [GENDER] and [Name] directly. Or you also could create a column like below   if [GENDER] ="male" and [Name]<>"John" then "1" else null, then filter this column which value not equal null.

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

camargos88
Community Champion
Community Champion

@jorgeran5 ,

 

Something like:

 

Table.SelectRows(STEP_NAME, each NAME <> "John")

 

or you can use the UI to filter directly by the NAME column.

 

Ricardo



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.