I have a requirement where I have a table like this,
Role Skills
Developer C
Developer SQL
Developer C++
Data Anal
The key here is to have distinct unrelated tables for your slicers.
Let's call your original table Jobs
.
Create two new tables:
Role = DISTINCT(Jobs[Role])
Skills = DISTINCT(Jobs[Skills])
Now that we have these tables, we can create slicers with them and read the selected values into our measures.
% Skill Match =
VAR SelectedRole = SELECTEDVALUE ( Role[Role] )
VAR RelatedSkills = CALCULATETABLE ( DISTINCT ( Jobs[Skills] ), Jobs[Role] = SelectedRole )
VAR CurrentSkills = DISTINCT ( Jobs[Skills] )
RETURN
DIVIDE (
COUNTROWS ( INTERSECT ( RelatedSkills, CurrentSkills ) ),
COUNTROWS ( CurrentSkills )
)
This reads in your selected role in the first variable. When we upskill, we read in the other slicer as well:
% Skill Match Upskilled =
VAR SelectedRole = SELECTEDVALUE ( Role[Role] )
VAR SelectedSkills = VALUES ( Skills[Skills] )
VAR RelatedSkills = CALCULATETABLE ( DISTINCT ( Jobs[Skills] ), Jobs[Role] = SelectedRole )
VAR CurrentSkills = DISTINCT ( Jobs[Skills] )
VAR Upskilled = DISTINCT ( UNION ( RelatedSkills, SelectedSkills ) )
RETURN
DIVIDE (
COUNTROWS ( INTERSECT ( Upskilled, CurrentSkills ) ),
COUNTROWS ( CurrentSkills )
)
The unused skill measure is very similar.
Unused Skills =
VAR SelectedRole = SELECTEDVALUE ( Role[Role] )
VAR SelectedSkills = VALUES ( Skills[Skills] )
VAR RelatedSkills = CALCULATETABLE ( DISTINCT ( Jobs[Skills] ), Jobs[Role] = SelectedRole )
VAR CurrentSkills = DISTINCT ( Jobs[Skills] )
VAR Upskilled = DISTINCT ( UNION ( RelatedSkills, SelectedSkills ) )
RETURN
CONCATENATEX ( EXCEPT ( Upskilled, CurrentSkills ), Jobs[Skills], ", " )
The result should look something like this:
You can add some logic to hide the role you've selected in the matrix visual, but I'm keeping things simpler here.