must_try_harder
New Member
- Joined
- Nov 27, 2024
- Messages
- 2
- Office Version
- 365
- Platform
- Windows
I have 2 tables:- 1 & 2 and I want to add a custom column to table 1 in power query which has a "Y" if the "item" in table 1 matches the "item" in table 2 and the "status_date" in table 1 is within "the location_start_date" and "location_end_date" range in table 2.
in power query I have both tables and have added custom columns to table1 to give me the first, last and all occurrences of the "location_start_date" but only the "Occurrence.First" and "Occurrence.Last work" expression work as expected - Occurence.All returns blanks? I can't see what I'm doing wrong - unless there a mistake in the expression maybe there is another way to do this?
First:
try table2[location_start_date]{List.PositionOf(
table2[item], [item],
Occurrence.First)} otherwise ""
Last:
try table2[location_start_date]{List.PositionOf(
table2[item], [item],
Occurrence.Last)} otherwise ""
All:
try table2[location_start_date]{List.PositionOf(
table2[item], [item],
Occurrence.All)} otherwise ""
in power query I have both tables and have added custom columns to table1 to give me the first, last and all occurrences of the "location_start_date" but only the "Occurrence.First" and "Occurrence.Last work" expression work as expected - Occurence.All returns blanks? I can't see what I'm doing wrong - unless there a mistake in the expression maybe there is another way to do this?
First:
try table2[location_start_date]{List.PositionOf(
table2[item], [item],
Occurrence.First)} otherwise ""
Last:
try table2[location_start_date]{List.PositionOf(
table2[item], [item],
Occurrence.Last)} otherwise ""
All:
try table2[location_start_date]{List.PositionOf(
table2[item], [item],
Occurrence.All)} otherwise ""