Forum Discussion
Merge two tables using Power Query with multiple conditions
- Anonymous4 years ago
Hi
You can do this in two steps:
First merge the two tables by transaction ID, it will create a new column that will have a table in each row.
Then create a new custom column to get only the value you want from those tables, filtering your date field:
= Table.AddColumn(#"Changed Type", "Amount", each let mydate = [Transaction_dt] in
Table.SelectRows([Table 2],
each [Sale_From_Dt] < mydate and
[Sale_To_Dt] >= mydate))After this you need to expand your new custom column by the fields you want
Hope it helps
Kind regards,
José
Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos! 🙂
Hi
You can do this in two steps:
First merge the two tables by transaction ID, it will create a new column that will have a table in each row.
Then create a new custom column to get only the value you want from those tables, filtering your date field:
= Table.AddColumn(#"Changed Type", "Amount", each let mydate = [Transaction_dt] in
Table.SelectRows([Table 2],
each [Sale_From_Dt] < mydate and
[Sale_To_Dt] >= mydate))
After this you need to expand your new custom column by the fields you want
Hope it helps
Kind regards,
José
Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos! 🙂
Thanks Anonymous for your response. I had applied the same steps that you mentione. However once I applied and processed, the model is taking ages to process the changes that I had applied. Any idea what was happening?