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
anushavikram
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
CheenuSing
Community Champion
Community Champion

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!

View solution in original post

2 REPLIES 2
CheenuSing
Community Champion
Community Champion

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!

@CheenuSing 

 

It worked. Though my logic was incorrect. 

Thank you. 

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.