Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
You have a model with 2 tables
TB_Codes
TD_Data
Considering that
CODE A Data = CODE A
COMPANY Data = COMPANY
SEASON Data >= SEASON
DATE Data >= DATE
Add in the table TD_Data the values corresponding to
PROCESS
DESTINATION
I need this solution in Power Query, not in DAX
Solved! Go to Solution.
Hi there,
Here's a Power Query transformation process with some dummy data based on your scenario, hopefully it would give you some ideas:) The data transformations are done mostly through UI and only with M where UI is not possible.
Assuming 'TB_Codes' looks like
and 'TB_Data' below
You would need to perform a Cross-outer join as in below picture with the help of an additional column.
and filter out the rows with below M
Table.SelectRows(#"Expanded TB_Codes", each
[CODE] = [CODE.1] and
[COMPANY] = [COMPANY.1] and
[SEASON] <= [SEASON.1] and
[DATE] <= [DATE.1])
In the end you would have below after deleting unused columns.
FYI, this is just a demo of one of the solutions. And if your tables are large multiple matches are possible, you may need to Group by original row ID or combination of 'CODE/COMPANY/SEASON/DATE' and use Max of Date to keep the most recent matching row.
You can find this demo file Here
Hi there,
Here's a Power Query transformation process with some dummy data based on your scenario, hopefully it would give you some ideas:) The data transformations are done mostly through UI and only with M where UI is not possible.
Assuming 'TB_Codes' looks like
and 'TB_Data' below
You would need to perform a Cross-outer join as in below picture with the help of an additional column.
and filter out the rows with below M
Table.SelectRows(#"Expanded TB_Codes", each
[CODE] = [CODE.1] and
[COMPANY] = [COMPANY.1] and
[SEASON] <= [SEASON.1] and
[DATE] <= [DATE.1])
In the end you would have below after deleting unused columns.
FYI, this is just a demo of one of the solutions. And if your tables are large multiple matches are possible, you may need to Group by original row ID or combination of 'CODE/COMPANY/SEASON/DATE' and use Max of Date to keep the most recent matching row.
You can find this demo file Here
Muchas gracias
Check out the July 2025 Power BI update to learn about new features.