Forum Discussion
Create a column with the maximun category
Hello, I have tow table like this related by idEmp. I want to create a column in the first table with the info about the principal activity of the employee, in this case the activity the empolyee gets most of his income.
| idEmp * (Pk) | Name | Principal Activity ????? |
| EMP00001 | John Cena | Chef |
| EMP00002 | Bon Jovi | Waiter |
| idEmp * | Category | Salary |
| EMP00001 | Chef | 1000 |
| EMP00001 | Waiter | 500 |
| EMP00001 | Kitchen boy | 200 |
| EMP00002 | Waiter | 2000 |
| EMP00002 | Kitchen | 700 |
Thank you in advance!!
94veiga , Better to have a rank column in table2
New column in Table 2
Rank = rankx(filter(Table2, [idemployee] =earlier([[idemployee])),[Salary])New column in table 1 =
new column = maxx(filter(Table2, Table2[idemployee] = Table1[Idemployee], Table2[Rank]=1),[Category])
2 Replies
- amitchandak
Super User
94veiga , Better to have a rank column in table2
New column in Table 2
Rank = rankx(filter(Table2, [idemployee] =earlier([[idemployee])),[Salary])New column in table 1 =
new column = maxx(filter(Table2, Table2[idemployee] = Table1[Idemployee], Table2[Rank]=1),[Category])- 94veiga
Helper II
Hello, thanks for your support. The first DAX worked perfectly but I'm having problems with the second one.