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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Retrieve number of occurence in data

Hi,

 

I have a skills filter with around 400 skills. I have data in table with people and their related skills. Something like given below:

 

PersonSkill
AX
BY
CZ
AY
AZ
BX
DZ
EX
FY
FZ
DX

 

Now, when i select X & Y in the skill slicer, i want a person measure to give a value of 2 because only A & B have both the skills, instead it is giving me 5 by filtering on distinct values on person column who have either X or Y. 

 

Measure suggested by someone on this community:

Measure =
VAR NumSlicedSkills_ =
    COUNTROWS ( DISTINCT ( Table1[Skill] ) )
RETURN
    SUMX (
        DISTINCT ( Table1[Person] ),
        INT ( CALCULATE ( COUNT ( Table1[Skill] ) ) = NumSlicedSkills_ )
    )

 

Final measure:

Actual count = IF(AND(COUNTROWS(rows)=DISTINCTCOUNT(Table[Person]),Skills[Selectedskillcount]>1),"",IF(OR(Skills[Selectedskillcount]=1,COUNTROWS(ALL(Skills[Skills]))=Skills[Selectedskillcount]),DISTINCTCOUNT(Table[Person]), [abovemeasure]))

 

3 databases:

Person-Skill

Task-Skill

Skill

 

Skill -> Merge of skills from rest of the 2 databases

 

Person-Skill
A
B

 

Task-Skill
B

C

 

Skill database
A
B
C

 

Selected skillsPerson-Skill - 67 rowsTask-Skill- 23 rows
A30
B6422
C01

 

Desired result:00

 

Current result:30

 

 

Another scenario:

 

Skill database
A
B
C
D

 

Person-Skill
A
B

D

 

Task-Skill
B
C
D

 

Detail Skill SetLevelPerson-Skill - 113 rows
ALevel 11
ALevel 221
ALevel 337
ALevel 45
BLevel 21
BLevel 32
DLevel 11
DLevel 211
DLevel 331
DLevel 43

 

Must have SkillsLevelTask-Skill - 79 rows
ALevel 11
ALevel 28
ALevel 311
ALevel 42
CLevel 21
DLevel 12
DLevel 214
DLevel 332
DLevel 48

 

First graph - Level wisePerson-SkillLevel 2Level 3Level 4
Current result4121

 

Second graph - OverallPerson-Skill
Current result3

 

 Person-SkillTask-Skill
Desired result00

 

0 REPLIES 0

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors