Forum Discussion
Using LOOKUPVALUE with dinamically created column names
- 10 years ago
Hi again,
Just to confirm that I was able to understand your porposal (and your comment regargin unpivoting the table)
I did created a temp unpivoted table via Power Query then the solution was easy to implement, which I achieved doing something like:
Shift = LOOKUPVALUE (
unpivot_from_table[Shift],
unpivot_from_table[Resource Name], current_table[Time Entry Resource Name],
unpivot_from_table[Week], WEEKNUM(current_table[week_start_date])
)The solution basically makes use of a LEFT JOIN in SQL implemented in DAX via the LOOKUPVALUE function as depicted in SQL BI's From SQL to DAX: Joining Tables article.
The unpivoted table (by creating a new tab in my Excel file and applying power query's Unpivot function, looks like:
unpivot_from_table
employee_name Week Shift emp1 10 1st emp1 11 2nd emp2 10 1st emp2 11 1st