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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Greg_Deckler
Super User
Super User

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


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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