cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

New Member

## Compare one column to all the others

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

2 REPLIES 2
New Member

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

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:

Community Support

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.

Best regards,

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Announcements

#### Power BI Monthly Update - July 2024

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

#### Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors