The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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:
Thank you!
Solved! Go to Solution.
= 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! |
= 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! |
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"