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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Power Query Editor - filter a query column based on another query column

I have the following situation:

One Date table with that includes information until the last date included in the SQL.

Google Analytics connection that includes Google Adwords Costs until the very moment the report is refreshed.

 

What I want to do: remove the days that are not covered in SQL (Date table) from the Google Adwords Costs.

I know that it can be done by using relationships, I know it can be done by using some merge transformations but due to the data model and other later merge operations I can not use that.

 

Is there any way to filter a column in a table in Power Query Editor based on a column in another table?

 

I attach a sample file here:

https://drive.google.com/file/d/13DSn7o8YSjLbaX4LVGL948qeWhEN0nHB/view?usp=sharing

 

This is the desired result in the sample file, eliminate every date after the MaxDate:

adriansuteu933_0-1623052103929.png

 

 

Thank you!

1 ACCEPTED SOLUTION
CNENFRNL
Community Champion
Community Champion

= let max =MaxDate[MaxDate]{0} in Table.SelectRows(#"Changed Type", each [Date] <= max)

Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

2 REPLIES 2
CNENFRNL
Community Champion
Community Champion

= let max =MaxDate[MaxDate]{0} in Table.SelectRows(#"Changed Type", each [Date] <= max)

Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Anonymous
Not applicable

Thank you @CNENFRNL !

It worked.

 

Full syntax used:

let
max =MaxDate[MaxDate]{0},
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("NcjBCQAgDAPAXfIWtLVWnEW6/xoiJPe8e5Hdug83NBiq/XBFMKZiMkKRjKVwRioOYys2qh4=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, Value = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Value", Int64.Type}}),
#"Filtered Rows" = Table.SelectRows(#"Changed Type", each [Date] <= max)

in
#"Filtered Rows"

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors