cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
anushavikram Frequent Visitor
Frequent Visitor

How to use a custom query as a filter in other tables

Hi, 

 

Im trying to filter all my tables based on a column in date_dim table. 

i.e filter all the rows of all tables greater than min date of the dim_date table. 

 

Im new to M query. Managed to genrate a blank query and wrote List.Min(dim_date[dim_date_key]) to get the min date. 

 

Im now struggling to use this query as a filter in the other tables. 

 

The following is the M code on the column which filtering using the results of Query. 

 

= Table.SelectRows(dbo_fact_booking, each [dim_booking_creation_dt_key] >= Query1)

 

Kindly suggest. 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: How to use a custom query as a filter in other tables

Hi @anushavikram 

 

You can add the step in the Second query, instead of as a separate query.

 

1. MinDate =List.Min(dim_date[dim_date_key]) ,

2. FileterTable = Table.SelectRows(dbo_fact_booking, each [dim_booking_creation_dt_key] >= MinDate)

 

 

Cheers

 

CheenuSing

Did I answer your question? Mark my post as a solution and also give KUDOS !

Proud to be a Datanaut!
2 REPLIES 2
Super User
Super User

Re: How to use a custom query as a filter in other tables

Hi @anushavikram 

 

You can add the step in the Second query, instead of as a separate query.

 

1. MinDate =List.Min(dim_date[dim_date_key]) ,

2. FileterTable = Table.SelectRows(dbo_fact_booking, each [dim_booking_creation_dt_key] >= MinDate)

 

 

Cheers

 

CheenuSing

Did I answer your question? Mark my post as a solution and also give KUDOS !

Proud to be a Datanaut!
anushavikram Frequent Visitor
Frequent Visitor

Re: How to use a custom query as a filter in other tables

@CheenuSing 

 

It worked. Though my logic was incorrect. 

Thank you.