Forum Discussion

PB2022's avatar
PB2022
New Member
4 years ago
Solved

Data relationship issue

Slicer(s) on one page do not filter correctly. When an option in the first slicer is selected, it filters out data in another slicer. It appears; that there is only one option under the slicer when there should be multiple options. When i change the relationship between two table from cross filter direction equal both to cross filter equal single. Then, pick two other tables changing the cross filter direction equal single to cross filter direction to both the slicers on the page work. However, visualizations on other pages do not work.  

Any suggestions? 

  • Hi PB2022 !

    Welcome to this amazing community πŸ™‚

    From my understanding, it seems you've activated the "both" direction in relationships to allow a measure to work, but that will indeed show the behavior you described: a slicer 1 filters slicer 2 and vice-versa.

    In this example, a "both" direction relationship means that not only the manufacturer filters product but also the product will filter the manufacturer:

    Manufacturer filters product:

    But Product also filters manufacturers:

     

    If the visuals are breaking, this might mean that the way your DAX formula is written, needs "Both".

    What you can do, for instance, is: simulate the "both" direction between your tables in your DAX measure.

    Something like:

    Measure with cross-filter  = 
    CALCULATE (
            [measure],
            CROSSFILTER ( table 1 [table 1 ID], table 2 [table 2 ID], Both)

    )

    For further detail on the use of cross-filter I recommend you this article: CROSSFILTER function - DAX | Microsoft Docs

     

    Hope I was of assistance!
    Cheers
    Joao Marcelino

    Ps- Did I answer your question? Mark my post as a solution! Kudos are also appreciated πŸ™‚

1 Reply

  • JoaoMarcelino's avatar
    JoaoMarcelino
    Responsive Resident

    Hi PB2022 !

    Welcome to this amazing community πŸ™‚

    From my understanding, it seems you've activated the "both" direction in relationships to allow a measure to work, but that will indeed show the behavior you described: a slicer 1 filters slicer 2 and vice-versa.

    In this example, a "both" direction relationship means that not only the manufacturer filters product but also the product will filter the manufacturer:

    Manufacturer filters product:

    But Product also filters manufacturers:

     

    If the visuals are breaking, this might mean that the way your DAX formula is written, needs "Both".

    What you can do, for instance, is: simulate the "both" direction between your tables in your DAX measure.

    Something like:

    Measure with cross-filter  = 
    CALCULATE (
            [measure],
            CROSSFILTER ( table 1 [table 1 ID], table 2 [table 2 ID], Both)

    )

    For further detail on the use of cross-filter I recommend you this article: CROSSFILTER function - DAX | Microsoft Docs

     

    Hope I was of assistance!
    Cheers
    Joao Marcelino

    Ps- Did I answer your question? Mark my post as a solution! Kudos are also appreciated πŸ™‚