Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi There,
I am looking for a filter measure or column syntax on a large table with users and skills where I would need to select/filter a user that has multiple skills and then I want to count a number value in another column.
Here is an example:
In the table example below I would like to get all users that can whistle and jump and sum up the hours for the matching ones.
User | hours | Skill |
user1 | 2 | whistle |
user2 | 4 | jump |
user1 | 3 | jump |
user2 | 6 | eat |
user3 | 7 | jump |
So following the logic the result would be just user1 that can jump and whistle and the hours is 2+3
user1 | 5 |
My attempts all failed so far, its easy to do this when checking for one or the other skill but getting only the ones that have both seems to quite difficult. Any ideas from the experts?
Solved! Go to Solution.
@kanebuddy
If you insert a slicer for Skill and select the skills the following measure should give you the numbers by users in a visual.
Measure = sum( table[hours])
If you need a measure with the filters then
Total Hours =
CALCULATE(
SUM(Table[hours]),
Table[Skill] IN {"jump", "whistle"}
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
You can create a measure with below code:-
Skill_Hour_Sum =
VAR current_selected_user =
MAX ( skills[User] )
VAR skills_count =
CALCULATE (
DISTINCTCOUNT ( skills[Skill] ),
FILTER (
skills,
AND (
skills[User] = current_selected_user,
OR ( skills[Skill] = "jump", skills[Skill] = "whistle" )
)
)
)
RETURN
IF (
skills_count >= 2,
SUMX ( DISTINCT ( skills[hours] ), skills[hours] ),
BLANK ()
)
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
You can create a measure with below code:-
Skill_Hour_Sum =
VAR current_selected_user =
MAX ( skills[User] )
VAR skills_count =
CALCULATE (
DISTINCTCOUNT ( skills[Skill] ),
FILTER (
skills,
AND (
skills[User] = current_selected_user,
OR ( skills[Skill] = "jump", skills[Skill] = "whistle" )
)
)
)
RETURN
IF (
skills_count >= 2,
SUMX ( DISTINCT ( skills[hours] ), skills[hours] ),
BLANK ()
)
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Hi Samarth, that worked like a charm. Many thanks for the lighning fast solution!
@kanebuddy
If you insert a slicer for Skill and select the skills the following measure should give you the numbers by users in a visual.
Measure = sum( table[hours])
If you need a measure with the filters then
Total Hours =
CALCULATE(
SUM(Table[hours]),
Table[Skill] IN {"jump", "whistle"}
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
57 | |
55 | |
55 | |
37 | |
30 |
User | Count |
---|---|
78 | |
66 | |
45 | |
44 | |
40 |