Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
94veiga
Helper II
Helper II

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)NamePrincipal Activity  ?????
EMP00001John CenaChef
EMP00002Bon JoviWaiter

 

idEmp *CategorySalary
EMP00001Chef1000
EMP00001Waiter500
EMP00001Kitchen boy200
EMP00002Waiter2000
EMP00002Kitchen700

 

Thank you in advance!!

1 ACCEPTED SOLUTION
amitchandak
Super User
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])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
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])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hello, thanks for your support. The first DAX worked perfectly but I'm having problems with the second one. 

 

94veiga_0-1616597004267.png

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors