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 August 31st. Request your voucher.

Reply
alfsender
New Member

Power BI Slicer using multiple table joins not working

I am new to PowerBI and trying to create a report along with a slicer. When I import my tables in Power BI, I see it recognizes relation properly. But when I add slicer it does not work.

My Tables are as below...


Table:1 > Region

idName
1APAC
2EMEA

 

Table:2 > Territory

idname
1Japan
2India
3Sri Lanka
4Japan
5London
6Paris
7Italy


Table:3 > Company

idname
1company-1 (Note: part of Apac region with India & Sri Lanka territory)
2company-2 (Note: part of Emea region with Paris & Italy territory)


Table:4 > region_territory


idregion_idterritory_id
111
212
313
414
525
626
727


Table:5 > company_region_territory

idcompany_idregion_territory_id
112
213
326
427


I am trying to create a slicer by "Region" name, so when I select Region as "APAC" it should show me total count of "Company" which has Region APAC assigned. When I connect PowerBI to my DB and select all above tables I see power bi has identified relationship properly, but still slicer does not work as expected.

Please share your valuable feedback to resolve this issue.


Thank you.

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

Hi  @alfsender ,

 

Create a measure as below:

Measure = 
var _id=CALCULATE(MAX('Region'[id]),FILTER(ALL(Region),'Region'[Name]=SELECTEDVALUE(Region[Name])))
var _territory=CALCULATETABLE(VALUES('region_territory'[territory_id]),FILTER(ALL(region_territory),'region_territory'[region_id]=_id))
var _companyid=CALCULATETABLE(VALUES('company_region_territory'[company_id]),FILTER(ALL(company_region_territory),'company_region_territory'[region_territory_id] in _territory))
Return
COUNTX(_companyid,[company_id])

And you will see:

v-kelly-msft_0-1620211518791.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

View solution in original post

1 REPLY 1
v-kelly-msft
Community Support
Community Support

Hi  @alfsender ,

 

Create a measure as below:

Measure = 
var _id=CALCULATE(MAX('Region'[id]),FILTER(ALL(Region),'Region'[Name]=SELECTEDVALUE(Region[Name])))
var _territory=CALCULATETABLE(VALUES('region_territory'[territory_id]),FILTER(ALL(region_territory),'region_territory'[region_id]=_id))
var _companyid=CALCULATETABLE(VALUES('company_region_territory'[company_id]),FILTER(ALL(company_region_territory),'company_region_territory'[region_territory_id] in _territory))
Return
COUNTX(_companyid,[company_id])

And you will see:

v-kelly-msft_0-1620211518791.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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