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

DATA Slice Interaction

Hi community,

 

I have a table with employee names and the department they work in. I have a data slice in Power BI Desktop that allows me to filter by the desired employee. I now want to add a table in the report that lists all employees who work in the same department as the filtered employee. The problem is that I have to set the interaction of the data slice with the employee name with the desired table to "none", otherwise only the employee filtered in the data slice will be displayed in the table, but not all employees in the department. How can I solve this problem?

 

Thanks for your help!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @David1205 ,

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

1. Create a name dimension table (DO NOT create any relationship with the fact table)

Employees = VALUES('Table'[Name])

2. Create a measure as below

Flag = 
VAR _emps =
    ALLSELECTED ( 'Employees'[Name] )
VAR _depts =
    CALCULATETABLE (
        VALUES ( 'Table'[Department] ),
        FILTER (ALLSELECTED( 'Table'), 'Table'[Name] IN _emps )
    )
RETURN
    IF ( SELECTEDVALUE ( 'Table'[Department] ) IN _depts, 1, 0 )

3. Create a slicer which apply the field [name] of dimension table and a table visual. Then apply a visual-level filter for the table visual with the condition (Flag is 1)

vyiruanmsft_0-1709023355772.png

Best Regards

View solution in original post

2 REPLIES 2
David1205
Frequent Visitor

Example:

 

Data Structure:

NameDepartment
LuisMarketing
FrankMarketing
PeterM&A
ValentinMarketing

 

In my report I set the data slicer "name" to "Valentin". The following table should then be displayed in my report: 

NameDepartment
LuisMarketing
FrankMarketing
ValentinMarketing
Anonymous
Not applicable

Hi @David1205 ,

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

1. Create a name dimension table (DO NOT create any relationship with the fact table)

Employees = VALUES('Table'[Name])

2. Create a measure as below

Flag = 
VAR _emps =
    ALLSELECTED ( 'Employees'[Name] )
VAR _depts =
    CALCULATETABLE (
        VALUES ( 'Table'[Department] ),
        FILTER (ALLSELECTED( 'Table'), 'Table'[Name] IN _emps )
    )
RETURN
    IF ( SELECTEDVALUE ( 'Table'[Department] ) IN _depts, 1, 0 )

3. Create a slicer which apply the field [name] of dimension table and a table visual. Then apply a visual-level filter for the table visual with the condition (Flag is 1)

vyiruanmsft_0-1709023355772.png

Best Regards

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.