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
Brunobp96
New Member

One person working for 2 different companies

Hey Guys, so what's my deal here:

 

I have a data set where I am evaluating people who work for different companies within the same conglomerate. so I have a visualization by name of the company, so I know how many people work for that one company. Also, I have a matrix with all the people listed in there and yes it can be duplicated rows for the same person if he works per se for two different companies. So when I select in my dashboard, it only shows the information regarding one of the companies, but is it possible for me to show all the results for the people who work for more than one company? 

 

Example

 

Brunobp96_0-1645642121199.png

 

So i need to be able to select for example NIKE on my dashboard and it should bring that Michael Jordan Works for Nike but also should show me another line saying that Michel Jordan Also works for Apple.

 

and i cant have a filter by employee it has to be thru the company filtering, i know its wierd haha

 

Any suggestions ?

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

Hi @Brunobp96,

It sounds like the multiple-step filter effect the default power bi filter operations are not supported.
For this scenario, you need to create an unconnected table with values that you want to choose and write a measure formula with DAX expression to check current row context and selection values to return tag.

Measure =
VAR currEmployee =
    SELECTEDVALUE ( Table[Employee] )
VAR selection =
    VALUES ( NewTable[Company] )
VAR employeeList =
    CALCULATETABLE (
        VALUES ( Table[Employee] ),
        FILTER ( ALLSELECTED ( Table ), [Company] IN selection )
    )
RETURN
    IF ( currEmployee IN employeeList, "Y", "N" )

After these steps, you can use this measure on the visual to achieve filter effects.

Applying a measure filter in Power BI - SQLBI

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

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @Brunobp96,

It sounds like the multiple-step filter effect the default power bi filter operations are not supported.
For this scenario, you need to create an unconnected table with values that you want to choose and write a measure formula with DAX expression to check current row context and selection values to return tag.

Measure =
VAR currEmployee =
    SELECTEDVALUE ( Table[Employee] )
VAR selection =
    VALUES ( NewTable[Company] )
VAR employeeList =
    CALCULATETABLE (
        VALUES ( Table[Employee] ),
        FILTER ( ALLSELECTED ( Table ), [Company] IN selection )
    )
RETURN
    IF ( currEmployee IN employeeList, "Y", "N" )

After these steps, you can use this measure on the visual to achieve filter effects.

Applying a measure filter in Power BI - SQLBI

Regards,

Xiaoxin Sheng

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

This is a variation of the "Filtering Up" pattern. You can do this with measures and pointer gymnastics.

 

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 work with. 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
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.