Forum Discussion
Create a nested table column in a table with date ranges from another table
- 7 years ago
Hi pwildmann,
I think you need to merge two tables into one by using merge queries or function like below
Table.SelectRows( Categories , (Magic) => Text.Contains( [LandingPage] , Magic[KeyPhrase] ) ), Then you could try create a custom column by compare each row
You could refer to PowerQuery(M)agic: Conditional Joins using Table.SelectRows() for details.
Best Regards,
Zoe ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi pwildmann,
I think you need to merge two tables into one by using merge queries or function like below
Table.SelectRows( Categories , (Magic) => Text.Contains( [LandingPage] , Magic[KeyPhrase] ) ), Then you could try create a custom column by compare each row
You could refer to PowerQuery(M)agic: Conditional Joins using Table.SelectRows() for details.
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
It worked great, thanks! So if I understand correctly by explicitly defining the function instead of using each you can then reference back to the original table through the function from within Table.SelectRows because the function originated in the original table?
#"RDM data" = Table.AddColumn(#"Added Conditional Column", "RDM", (magic) => Table.SelectRows(#"Cel 2 RDM", each [Time] >= magic[#"Date + time"] and DateTime.Date([Time]) <= DateTime.Date(magic[#"Harvest day 1"])))
This did the trick. Still some messy type conversion, I know, but I'll fix that later. I'm new to M and it's not like any other programming or query language I've used before, I was stuck on this one for longer than I care to admit. Most things still feel a little counter intuitive at times.