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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.