Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello!
I am not sure if this is the best way of doing this but I have 2 different tables, one with a reference and the other one with the evaluation of the people. I need to compare the evaluation column of each person to one of the activities reference in the other table and then give a grade to each person accordingly to the evaluation. In table 2 we just have binary evaluation, someone has or not a skill, table 2 has levels, 0, 1, 2 and 3. I am just adding some data similar to what I have.
Table 1 - Reference
Skill code | Activitie 1 | Activitie 2 |
CG002.9 | 3 | 2 |
CG001.10 | 2 | 2 |
CG002.2 | 1 | 0 |
Table 2 - People
Skill | Person 1 | Person 2 | Person 3 |
CG002.9 | 1 | 0 | 1 |
CG001.10 | 1 | 0 | 1 |
CG002.13 | 1 | 0 | 1 |
CG002.7 | 0 | 0 | 1 |
CG002.2 | 0 | 1 | 1 |
CG001.1 | 0 | 0 | 0 |
What I need is to compare each column in table 2 to all columns in table 1 and have this result for each person and each activitie:
Person 1 doesn't have all level 1 skills for activitie 1
Person 2 has all level 1 skills for activitie 1
Person 3 has all level 1 skills for activitie 1
Thanks in advance
Thank you very much for your reply.
Well, I think it solves part of the problem. Actually the goal is to check if, for example, Person 1 has all Level 1 skills for activitie 1. Then do it to all other people and activitie levels and give them grades based on these criteria:
If (has all level 2 and level 3) -> min_grade = 7
esleif(has all level 3) -> min_grade = 4
else -> min_grade = 0
grade = min_grade + 3*(all level 1 that a person has)/(all level 1 of the activitie)
So that the max grade would be 10.
The result table should be something like this (with random numbers for grades here as example):
Person | Activitie 1 | Activitie 2 | Activitie 3 |
Person 1 | 7 | 10 | 4 |
Person 2 | 1 | 5 | 4,5 |
Person 3 | 3 | 8 | 7,8 |
I did it on Excel (a not very elegant or automated (but easy) solution) but it seems to be way harder to do in Power BI.
I used the formula below to each grade, where colums A to DY are the activities and DY until the end are the people:
=IFERROR(IF(COUNT.IF(Compilado!A2:A1117;"3";Compilado!$DY$2:$DY$1117;1)+COUNT.IF(Compilado!A2:A1117;"2";Compilado!$DY$2:$DY$1117;1)>=CONT.IF(Compilado!A2:A1117;"3")+CONT.IF(Compilado!A2:A1117;"2");7;
IF(COUNT.IF(Compilado!A2:A1117;"3";Compilado!$DY$2:$DY$1117;1)>=CONT.IF(Compilado!A2:A1117;"3");4;0)) +
3*COUNT.IF(Compilado!A2:A1117;"1";Compilado!$DY$2:$DY$1117;1)/CONT.IF(Compilado!A2:A1117;"1");0)
Hi @thiagofnds ,
Please unpivot columns for ‘people’ table in Power Query like shown below:
You will get a table like this:
The relationship between two tables:
Please try following DAX to create a measure:
Measure =
VAR _VALUE = SELECTEDVALUE('People'[Value])
VAR _ACT = MAX('Reference'[Activitie 1])
RETURN
IF(_VALUE = 1, _ACT)
Create a table visual, you can give a grade to each person accordingly to the evaluation.
If I misunderstand your demands, please feel free to contact us in time.
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
113 | |
94 | |
88 | |
32 | |
28 |
User | Count |
---|---|
153 | |
101 | |
82 | |
63 | |
52 |