Forum Discussion
Multiple column and Table Query Dependant on values
- 3 years ago
Hi YellowSquirrel ,
Assuming that your Table2 isn't referenced from Table1, then the simplest and clearest way would probably be to merge Table2 onto Table1 on Table1[EmployeeName] = Table2[EmployeeName] and expand Table2[EmployeeNumber].
Then do the same, but on Table1[EmployeeNumber] = Table2[EmployeeNumber] and expand Table2[EmployeeName].
You can now create two new custom columns, something like this:
employeeNumberClean = if [Employee Number] = 0 then [Table2.Employee Number] else [Employee Number] employeeNameClean = if [Employee Name] = "0" then [Table2.Employee Name] else [Employee Name]I've attached a PBIX below with the query to change this:
...to this:
Pete
- 3 years ago
Ah ok apologies, I'll repost there.
Hi Pete,
Thanks for the recommendation although for me to merge these it causes a lot of issues with the rest of the data/tables/calculations already in the dashboard so I'm hoping to resolve it with a DAX query instead
No problem.
In future, you should post DAX queries to either the Desktop forum or the DAX forum. This is the Power Query forum, so you'll get Power Query answers.
Pete
- YellowSquirrel3 years agoFrequent Visitor
Ah ok apologies, I'll repost there.