I have a table with Name and Objectives in DAX (Smart,Bold,Agile,Not).
Each person can belong to one or more than one objective and I have one row per each objective
Name | Objective
John Dorian | Smart
John Dorian | Agile
Bob | Agile
Bob | Bold
Bob | Smart
John Dorian | Not
John Dorian | Smart
Pluto | Not
Pluto | Bold
Falcon | Not
i.e : John can belong to Smart, Not,Agile <br.
I’m trying in PowerBI to show a matrix per each objectives the number of people who chosed the different objectives
Smart 2 (it appears in John Dorian, Bob)
Agile 2 (it appears in John Dorian, Bob)
Not 3 (it appears in Pluto,Falcon,John Dorian)
Bold 2 (it appears in Pluto, Bob)
If John Dorian has been counted already in one of these Objectives, I don’t have to recount it when I found it in other objectives (Agile,Not).
This is what my matrix shows when I try to put on rows the objectives and on values the distinct count of ID
The number doesn’t match up.
I figured out that a person can belong to more than one type of Objective, so I have almost found the culprit,so I wrote this formula
Worker Objectives Count =
CALCULATE(
COUNTROWS('My Table'),
ALLEXCEPT('My Table', 'My Table'[Name])
)
and then create a measure Count Workers Once =
SUMX(
VALUES(MyTable[Name]),
IF(
[Worker Objectives Count] > 1,
1,
1
)
)
Is there a way to solve this problem?