Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Contains not working when table not related!

Hi,   I have two tables(a & b) and both are not linked.   so ideally what i'm trying to do is filter table a when table b has a selection.   I understand this is much easier when its related bu...
  • Icey's avatar
    Icey
    6 years ago

    Hi Anonymous ,

     

    Change your Measure 3 and Measure 4 like so:

    Measure 3 = 
    COUNTROWS (
        FILTER (
            ALLSELECTED ( Detailed ),
            Detailed[id] = MAX ( Detailed[id] )
                && Detailed[start city] IN VALUES ( City[Cities] )
        )
    )
    
    Measure 4 = 
    COUNTROWS (
        FILTER (
            ALLSELECTED ( Detailed ),
            Detailed[id] = MAX ( Detailed[id] )
                && Detailed[end city] IN VALUES ( City[Cities] )
        )
    )
    

     

    Or, just create a measure like so:

    Filter Measure = 
    COUNTROWS (
        FILTER (
            ALLSELECTED ( Detailed ),
            Detailed[id] = MAX ( Detailed[id] )
                && (
                    Detailed[end city] IN VALUES ( City[Cities] )
                        || Detailed[start city] IN VALUES ( City[Cities] )
                )
        )
    )
    

     

     

    Best Regards,

    Icey

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.