Forum Discussion

alfsender's avatar
alfsender
New Member
5 years ago
Solved

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 Tabl...
  • v-kelly-msft's avatar
    5 years ago

    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:

    For the related .pbix file,pls see attached.

     

    Best Regards,
    Kelly

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