Forum Discussion
YellowSquirrel
3 years agoFrequent Visitor
Multiple column and Table Query Dependant on values
I have a report with multiple tables, I have created as summarized table of the Employee Number and Employee Names Column as I realised that two of the tables aren't matching from the data that is fe...
- 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.
BA_Pete
3 years agoSuper User
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
YellowSquirrel
3 years agoFrequent Visitor
Ah ok apologies, I'll repost there.