Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Filter Data with Multiple Filter Conditions

Hello, I'm looking for a solution to implement filtering capability that will allow end-user to find individuals with matching skillset. I have two tables loaded into Power BI:   Employee User...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Anonymous ,

    I created a sample pbix file(see the attachment), please check if that is what you want.

    1. Please DO NOT create any relationship between the table 'Employee' and 'Skills'

    2. Create a measure as below 

    Flag =
    VAR _seluserid =
        SELECTEDVALUE ( 'Employee'[UserID] )
    VAR _selskills =
        ALLSELECTED ( 'Skills'[Skill] )
    VAR _scount =
        COUNTROWS ( _selskills )
    VAR _tab =
        SUMMARIZE (
            'Skills',
            'Skills'[UserID],
            "@count",
                CALCULATE (
                    DISTINCTCOUNT ( 'Skills'[Skill] ),
                    FILTER (
                        'Skills',
                        'Skills'[UserID] = _seluserid
                            && 'Skills'[Skill] IN _selskills
                    )
                )
        )
    VAR _ecount =
        SUMX ( _tab, [@count] )
    RETURN
        IF ( _ecount >= _scount, 1, 0 )

    3. Create a visual and apply the visual-level filter on the visual with the condition(Flag is 1)

    If the above one can't help you get the expected result, could you please provide some raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:

    How to provide sample data in the Power BI Forum

    How to Get Your Question Answered Quickly

    And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

    How to upload PBI in Community

    Best Regards