Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Issues with Filtering Across Indirect Relationships in Power BI between two tables

I'm having trouble with filtering across multiple tables where there's an indirect relationship, and I'd appreciate some guidance on how to fix this. Here's my setup: Food Entities - Table showing...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Anonymous ,

     

    Please create a new calendar table:

    Calendar = 
    CALENDAR (
        MIN (
            MIN ( 'Food_Entities'[Publishedon] ),
            MIN ( 'Relation_Association'[PublishedOn] )
        ),
        MAX (
            MAX ( 'Food_Entities'[Publishedon] ),
            MAX ( 'Relation_Association'[PublishedOn] )
        )
    )

    Two-side relationships should be avoided in the model as much as possible, and if needed please turn them on in the code:

    Count_contaminant = 
    CALCULATE (
        COUNT ( 'Relation_Association'[food] ),
        CROSSFILTER ( 'Intermediate table'[Intermediate table], 'Food_Entities'[Food], BOTH )
    )

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
    If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum