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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
STP_Brazil
New Member

Add fields by matching >=, greater than or equal to, in POWER QUERY

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

1 ACCEPTED SOLUTION
MasonMA
Impactful Individual
Impactful Individual

@STP_Brazil 

 

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

MasonMA_0-1752938346936.png

and 'TB_Data' below

MasonMA_1-1752938401998.png

You would need to perform a Cross-outer join as in below picture with the help of an additional column.

MasonMA_2-1752938467220.png

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.

MasonMA_3-1752938580558.png

 

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

View solution in original post

2 REPLIES 2
MasonMA
Impactful Individual
Impactful Individual

@STP_Brazil 

 

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

MasonMA_0-1752938346936.png

and 'TB_Data' below

MasonMA_1-1752938401998.png

You would need to perform a Cross-outer join as in below picture with the help of an additional column.

MasonMA_2-1752938467220.png

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.

MasonMA_3-1752938580558.png

 

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

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

Top Solution Authors