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

Slicer Value from different table

I have two tables, one listing each investigator individually, and their years of experience. The second table lists each research team, and the status of the investigator on that team (active or inactive). Investigators can be active memebrs in more than one team. I have a define relationship between these tables linked by the investigator's email (the consistent value shared between each).

 

I have a report built that shows data about the all the investigators who are participating - average years of experience, count of each with a given academic rank, etc...

 

I want to be able to add a slicer to show this same data based by team for only investigators active on that. Adding the team name column to the slicer does not return the expected data. How can i link these two tables to create this slicer?

 

The tables are set up:

Table 1

Investigator NameInvestigator EmailYears of ExperienceAcademic Rank
Janejane@college.edu10Professor
Timtim@college.edu5Associate Professor
Katekate@college.edu8Associate Professor
Nicknick@college.edu15Assistant Professor

 

Table 2

Team NameInvestigator EmailStatus on Team
Team 1nick@college.eduActive
Team 2nick@college.eduNot Active
Team 1kate@college.eduNot Active
Team 2Kate@college.eduActive
Team 1jane@college.eduActive
Team 2jane@college.eduActive
1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @katemke ,

Please create a measure as below to get the average year of experience of active investigators on team:

Average year of experience = 
VAR _selTeam =
    ALLSELECTED ( 'Table 2'[Team Name] )
RETURN
    CALCULATE (
        AVERAGE ( 'Table 1'[Years of Experience] ),
        FILTER (
            'Table 2',
            'Table 2'[Team Name] IN _selTeam
                && 'Table 2'[Status on Team] = "Active"
        )
    )

Slicer Value from different table.JPG

If the above one is not what you want, please provide your expected result and explain the details with examples. Thank you.

Best Regards

Rena

Community Support Team _ Rena
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-yiruan-msft
Community Support
Community Support

Hi @katemke ,

Please create a measure as below to get the average year of experience of active investigators on team:

Average year of experience = 
VAR _selTeam =
    ALLSELECTED ( 'Table 2'[Team Name] )
RETURN
    CALCULATE (
        AVERAGE ( 'Table 1'[Years of Experience] ),
        FILTER (
            'Table 2',
            'Table 2'[Team Name] IN _selTeam
                && 'Table 2'[Status on Team] = "Active"
        )
    )

Slicer Value from different table.JPG

If the above one is not what you want, please provide your expected result and explain the details with examples. Thank you.

Best Regards

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
FrankAT
Community Champion
Community Champion

Hi @katemke ,

you can build a table which holds all emails addresses distinct. The model would look like (see figure):

 

Model viewModel view

 

The sample report uses the emails from table EMails in the slicer (see figure):

Sample reportSample reportRegards FrankAT

Greg_Deckler
Super User
Super User

@katemke - One possible way would be to filter your visual by "Active". You might need to do something along the lines of a complex selector. https://community.powerbi.com/t5/Quick-Measures-Gallery/The-Complex-Selector/m-p/1116633#M534


Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.