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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Search a Filtered Data

I have one csv-based data source that contains employees and skills data. Here's a simplified version of the data file:

JB78116_0-1648666866378.png

For the dashboard, user would like to know the top 5 skills in their respective department. A user from HR would get this result:

JB78116_1-1648666889069.png

 

The next requirement that I'm struggling with is to find employees with matching skills that sit in other departments. The expected results:

JB78116_2-1648666905391.png

 

Any advice?

1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please try the following measures:

 

 

CountSkill = COUNT ( 'Table'[Skill] )
TOP5 = 
VAR ranknum =
    RANKX (
        ALLSELECTED ( 'Table'[Skill] ),
        CALCULATE (
            [CountSkill],
            ALLEXCEPT ( 'Table', 'Table'[Skill], 'Table'[Department] )
        ),
        ,
        DESC,
        SKIP
    )
RETURN
    IF ( MAX ( 'Table'[Department] ) = "HR" && ranknum <= 5, ranknum )
Measure = 
VAR tab =
    FILTER (
        SUMMARIZE (
            ALLSELECTED ( 'Table' ),
            'Table'[Department],
            'Table'[Skill],
            "Top", [TOP5]
        ),
        [Top] <> BLANK ()
    )
RETURN
    IF (
        MAX ( 'Table'[Department] ) <> "HR"
            && MAX ( 'Table'[Skill] ) IN CALCULATETABLE ( ALLSELECTED ( 'Table'[Skill] ), tab ),
        1
    )

 

vkkfmsft_0-1649065816145.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-kkf-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please try the following measures:

 

 

CountSkill = COUNT ( 'Table'[Skill] )
TOP5 = 
VAR ranknum =
    RANKX (
        ALLSELECTED ( 'Table'[Skill] ),
        CALCULATE (
            [CountSkill],
            ALLEXCEPT ( 'Table', 'Table'[Skill], 'Table'[Department] )
        ),
        ,
        DESC,
        SKIP
    )
RETURN
    IF ( MAX ( 'Table'[Department] ) = "HR" && ranknum <= 5, ranknum )
Measure = 
VAR tab =
    FILTER (
        SUMMARIZE (
            ALLSELECTED ( 'Table' ),
            'Table'[Department],
            'Table'[Skill],
            "Top", [TOP5]
        ),
        [Top] <> BLANK ()
    )
RETURN
    IF (
        MAX ( 'Table'[Department] ) <> "HR"
            && MAX ( 'Table'[Skill] ) IN CALCULATETABLE ( ALLSELECTED ( 'Table'[Skill] ), tab ),
        1
    )

 

vkkfmsft_0-1649065816145.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

This is super neat. Thank you so much.

lbendlin
Super User
Super User

Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to assist you. Avoid posting screenshots of your source data if possible.

Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.