Forum Discussion

TCFPA's avatar
TCFPA
Frequent Visitor
3 years ago
Solved

1 to Many relationship is not filtering properly.

I have this going on with two separate relationships but for the sake of this question we will focus on one.   I have a Fact table full of a given services info and a separate region lookup table ...
  • Barthel's avatar
    3 years ago

    Hey TCFPA,

    Your relationship is now set up so that the one-side filters the many-side, not the other way around. You can recognize this by the direction of the arrow in the relationship. 

    Because the jobs do not filter the regions, the total of the regions is shown everywhere.

    You can do two things: 1. make the relationship bidirectional default 2. create a measure in which you make the relationship bidirectional specifically for that calculation.

    1. Bidirectional:
    2. Measure:

     

    Measure = 
    CALCULATE ( 
        COUNTROWS ( Region ),
        CROSSFILTER ( Region[region], Job[region], Both )
    )​

     

    Result 

    There are some limitations to bidirectional relationships. Learn more about it here: https://learn.microsoft.com/en-us/power-bi/guidance/relationships-bidirectional-filtering