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
AndreWahlbuhl
Frequent Visitor

User filter with AND

Hello! 

 

I have a table of employess and competences. I need to create a tool to for the user to  select the employee based on his/her cmpetences. But, if the user select more than one I need powerBI to show only the ones who has that selected competences. 

 

Anyone can give-me a clue? Thnaks a lot!

1 ACCEPTED SOLUTION

HI @AndreWahlbuhl,

You can refer to the following steps to achieve your requirement.

Steps:

1. Extract skill value from the raw table to create a calculated table selector.

Selector = VALUES('Table'[Skill])

2. Write a measure to compare the value between selection and current table row contents.

All Match = 
VAR selection =
    VALUES ( Selector[Skill] )
VAR summary =
    FILTER (
        GROUPBY (
            FILTER ( ALLSELECTED ( 'Table' ), [Skill] IN selection ),
            [Name],
            "SC", COUNTX ( CURRENTGROUP (), [Skill] )
        ),
        [SC] = COUNTROWS ( selection )
    )
RETURN
    IF (
        SELECTEDVALUE ( 'Table'[Name] ) IN SELECTCOLUMNS ( summary, "Name", [Name] ),
        "Y",
        "N"
    )

3. Use the selector table field to create a slicer, raw table fields create a table visual. Then apply measure on table visual 'visual level filter ' to filter records.

89.gif

I also attached the sample file below.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

4 REPLIES 4
v-shex-msft
Community Support
Community Support

Hi @AndreWahlbuhl,

I'm not so clear for your description, can you please explain more about them with some dummy data and expected result? 
How to Get Your Question Answered Quickly 
Do you mean if the user selects multiple items and you want to display the employees that match with the selection ranges? if this a case, I'd like to suggest you use an unconnected table as the source of slicer, then you can write a measure to compare current row contents and selection ranges (use in operator) and applied on the 'visual level filter' of your visuals.

The IN operator in DAX 

Applying a measure filter in Power BI 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hello @v-shex-msft , I am very pelased you are atryin to help me and I am sorry for not been specific. 

In fact, the links and descriptions you told was usefull in other subjects I had. But for that doubt, I´ll try to express myself cleary.

 

Dummy Table

 

NameSkill
AndreMath
AndreSocial Science
CharlesMath
CharlesChemistry
CharlesComputer Logic
AnnaBiology

Anna

Computer Logic

Anna

Math

 

When selecting the desired qualifications, I would like the PBI to show only the person who has these specific characteristics.

Example:
When I select only Math, the system needs to show me either Andre, Charles and Anna.

But if I select Math and Computer Logic, it will only have to show me Charles and Anna because they´re only to have both skills. 

 

Since then I am very pleased. Thaks for your help. 

HI @AndreWahlbuhl,

You can refer to the following steps to achieve your requirement.

Steps:

1. Extract skill value from the raw table to create a calculated table selector.

Selector = VALUES('Table'[Skill])

2. Write a measure to compare the value between selection and current table row contents.

All Match = 
VAR selection =
    VALUES ( Selector[Skill] )
VAR summary =
    FILTER (
        GROUPBY (
            FILTER ( ALLSELECTED ( 'Table' ), [Skill] IN selection ),
            [Name],
            "SC", COUNTX ( CURRENTGROUP (), [Skill] )
        ),
        [SC] = COUNTROWS ( selection )
    )
RETURN
    IF (
        SELECTEDVALUE ( 'Table'[Name] ) IN SELECTCOLUMNS ( summary, "Name", [Name] ),
        "Y",
        "N"
    )

3. Use the selector table field to create a slicer, raw table fields create a table visual. Then apply measure on table visual 'visual level filter ' to filter records.

89.gif

I also attached the sample file below.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

I am very thankful for your answer.

In fact it is very well explained and well detailed. If I could I woud give you an A++.

 

And sorry for dalying the answer, I had some personal trouble. 

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 Kudoed Authors