Forum Discussion
NewbiePowerBye
8 years agoHelper I
If Condition: Date comparison from two different tables
Hello, I have the following tables(as a preview): Table A: ID InProgressDate SolvedDate 1 2/5/2018 2/7/2018 2 2/6/2018 2/8/2018 3 ...
- 8 years ago
I would think that your column would go something along the lines of:
Column = MAXX(FILTER(ALL('Table B'),'Table B'[Start Date]>=[InProgressDate] && 'Table B'[End Date]<=[SolvedDate]),[Phase]) - 8 years ago
You can add column to your Table A like so:
let Source = TableA, #"Added Custom" = Table.AddColumn(Source, "Custom", each Table.SelectRows(TableB, (tblB) => tblB[StartDate] <= _[InProgressDate] and tblB[EndDate] >= _[SolvedDate])), #"Expanded Custom" = Table.ExpandTableColumn(#"Added Custom", "Custom", {"Phase"}, {"Phase"}) in #"Expanded Custom"code in "Add-column"-dialogue:
ImkeF
8 years agoCommunity Champion
You can add column to your Table A like so:
let
Source = TableA,
#"Added Custom" = Table.AddColumn(Source, "Custom", each Table.SelectRows(TableB, (tblB) => tblB[StartDate] <= _[InProgressDate] and tblB[EndDate] >= _[SolvedDate])),
#"Expanded Custom" = Table.ExpandTableColumn(#"Added Custom", "Custom", {"Phase"}, {"Phase"})
in
#"Expanded Custom"code in "Add-column"-dialogue:
NewbiePowerBye
8 years agoHelper I
Thank you a lot for the help ImkeF! It worked! :)