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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
soxy
Frequent Visitor

Compare 2 lists in 2 different tables

Hey Guys!

I hope you can help me out. I have to compare 2 Lists in 2 Tables (dosen't matter if this happens in DAX or M). 

The goal is to create a new column "EmployeeCanHelp" in the Table "Projects". 

Employee's should be added to the column if they have at least 1 skill. Their can be more then one Employee, so this have to be a new List

 

Example: 

Employee1, John Doe has the skills: "Skill1", "Skill3", "Skill4". He is responsible for ProjectID "1" and "2". He could help out with ProjectId "3", "4" and "5"

ProjectID "3" skills are "Skill2" and "Skill5", so he couldn't help out their but in ProjectId "4" and "5" 

 

Solution:

Table "Projects"

ProjectIDProjectNameProjectSkillsNeededEmployeeIDEmployeeCanHelp
1

Project1

Skill1, Skill2, Skill51Maria Doe
2Project2Skill5, Skill4, Skill1, Skill21Maria Doe, Albert Albertson
3Project3Skill2, Skill52None
4Project4Skill2, Skill43John Doe, Maria Doe
5Project5Skill5, Skill2, Skill42John Doe, Albert Albertson

 

I have following data: 

Table: "Employee"

EmployeeIdEmployeeNameEmployeeSkills
1John DoeSkill1, Skills3, Skill4
2Maria DoeSkill4, Skill2, Skill5
3Albert AlbertsonSkill4, Skill3

 

Table: "Projects"

ProjectIDProjectNameProjectSkillsNeededEmployeeID
1

Project1

Skill1, Skill2, Skill51
2Project2Skill5, Skill4, Skill1, Skill21
3Project3Skill2, Skill52
4Project4Skill2, Skill43
5Project5Skill5, Skill2, Skill42


I hope you can help me out, because I run out of ideas and don't get it to work. 
Already tried this one out: Solved: How to transform & compare 2 columns having multip... - Microsoft Power BI Community but I couldn't get it to work. 

 

Thank you so much in advance and I wish you some wonderfull days. 

Alex 

1 ACCEPTED SOLUTION
CNENFRNL
Community Champion
Community Champion

Tricky solution with PQ,

CNENFRNL_0-1651139706043.png

Check your mock-up. For project4 (needs 2,4) in the charge of empl3 (3,4), only empl2 possesses skill2; why empl3 is chosen? For project5, I didn't see any necessity of extra aide since empl2 possesses all skills needed.


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

4 REPLIES 4
CNENFRNL
Community Champion
Community Champion

Tricky solution with PQ,

CNENFRNL_0-1651139706043.png

Check your mock-up. For project4 (needs 2,4) in the charge of empl3 (3,4), only empl2 possesses skill2; why empl3 is chosen? For project5, I didn't see any necessity of extra aide since empl2 possesses all skills needed.


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

DAX solution is even trickier and fairly complex. For fun only (dataset is tweaked for verification),

CNENFRNL_0-1651171957563.png

CNENFRNL_1-1651171981060.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

soxy
Frequent Visitor

It works perfect. Thank you so much!

soxy
Frequent Visitor

Thank you for the reply, I will test it after the reply. 

 

For Project4:
For the EmployeeCanHelp it's required that at least one skill matches. 

 

For Project5:

We need a list of employees that the department can choose one in the list, because they maybe dont want to assign a specific person to that project. 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.