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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Filter rows in Query editor

Hello,

 

I want to create 2 new queries (query B, query C) from a single query (query A) in query editor. In query B I want to filter "male" (Gender="male) and on the other query (query C) I want to filter "female" (Gender="female").

 

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

 

Many thanks,

MariosChr90

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Anonymous,

 

I will give you the example for 1 table but just replicate the steps.

 

On the query editor

1 - On query A right click and choose reference (one with the clip icon) doing referece will allow you to update all your tables when you make changes to query A

2 - Filter out the column or columns you need or change or add columns as needed

 

duplicate.gif

 

Regards,

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

4 REPLIES 4
MFelix
Super User
Super User

Hi @Anonymous,

 

I will give you the example for 1 table but just replicate the steps.

 

On the query editor

1 - On query A right click and choose reference (one with the clip icon) doing referece will allow you to update all your tables when you make changes to query A

2 - Filter out the column or columns you need or change or add columns as needed

 

duplicate.gif

 

Regards,

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Many thanks for your answer,

 

I still have an issue. I joined two tables and when use a column which belongs to the other table to filter out some rows it does not exclude the whole rows but keeps these rows and I get nulls in the value I filtered out. 

 

If this is not clear please let me know. 

 

Many thanks,

MariosChr90

Anonymous
Not applicable

HI @Anonymous,

 

So you join other tables and try to filter on original table to enable the filter effect to merge table, right?

If this is a case, I don't think it possible.(power query functions not support these operations)

 

If you filter on original tables, it can't analysis these source data and refresh merge table. You need to delete current steps and apply the filter before merge table.

 

Regards,

Xiaoxin Sheng

Greg_Deckler
Community Champion
Community Champion

Easiest way is just to copy query A to query B and C and in those queries, filter as necessary.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.