Forum Discussion
dudeyates
5 years agoFrequent Visitor
Add New Column That Retrieves Value From Another Table
Hi all, I have two tables. They are not linked by a relationship. Table 1 has billed timecard entries Table 2 is position data The goal is to classify each labor hour entry as student, tempo...
- 5 years ago
Hi dudeyates ,
you can do it like this:
position_type = VAR _Table = FILTER ( Table2, Table1[emp_id] = Table2[emp_id] && Table1[work_date] >= Table2[start_date] && Table1[work_date] <= Table2[end_date] ) RETURN MINX ( _Table, Table2[position_type] )With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)
HotChilli
5 years agoCommunity Champion
Try and replace the VALUES with MIN so that you can try and get past the error which seems to be returning more than one entry for the same filter conditions. I can't see (from the data shown) which conditions would allow that but let's start with that.
If you get past the error but a wrong result is in one of the rows, try and narrow in on that to debug.
Can you confirm that the datatypes are the same for each column that is compared in the filter i.e. date with date, int with int?