Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
jkim3743
New Member

DAX measure over different tables. Make interaction between tables.

DAX measure over different tables. Make interaction between tables.
 

I need to make interactions between tables.

1. departments table: contains department name.

2. employees table: contains sex. 

 

I created male/female count. I want to have interaction so when I click each department button, gender distribution changes by each department.

 

Here's my measure: 

Male Count = CALCULATE(COUNTA(employees[sex]), (employees[sex]) = "M")
Female Count = CALCULATE(COUNTA(employees[sex]), (employees[sex]) = "F")
 
However, when I click each department button, gender distribution chart does not change even if I turn interaction on.
 
Here's my relationships and dashboardCapture.PNG
jkim3743_0-1735158110387.png

 

 

I think it has to deal with 'dept_emp' table since there's no direct relationship between 'employees' and 'departments' tables.

Can somebody help?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @jkim3743 ,

I created a sample pbix file(see the attachment), please check if that is what you want. Please change the Cross-filter direction between the table 'dept_emp' and 'employees' as "Both" :

vyiruanmsft_0-1735178764570.png

Then the count will be dynamically changed by the department selections:

vyiruanmsft_0-1735179115904.png

Best Regards

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

Please try something like below, if you cannot change the filter direction in the data model.

 

Male Count =
CALCULATE (
    COUNTROWS ( SUMMARIZE ( dept_emp, employees[sex] ) ),
    employees[sex] = "M"
)

 

Female Count =
CALCULATE (
    COUNTROWS ( SUMMARIZE ( dept_emp, employees[sex] ) ),
    employees[sex] = "F"
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

Hi @jkim3743 ,

I created a sample pbix file(see the attachment), please check if that is what you want. Please change the Cross-filter direction between the table 'dept_emp' and 'employees' as "Both" :

vyiruanmsft_0-1735178764570.png

Then the count will be dynamically changed by the department selections:

vyiruanmsft_0-1735179115904.png

Best Regards

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.