Forum Discussion

YO_CO's avatar
YO_CO
Frequent Visitor
1 year ago
Solved

Related data with cross filters

Hi all, after 3 hours arguing with ChatGPT/Claude and getting 0 results, perhaps you can help with something I assumed was a simple matter but am struggling.   I have 2 tables: FactOrders - conta...
  • johnt75's avatar
    1 year ago

    Create a disconnected table for use in the slicer like

    Orders for slicer = DISTINCT( 'Fact Orders'[Order ID] )

    Create a measure for use as a filter

    Order is visible =
    VAR CurrentOrder =
        SELECTEDVALUE ( 'Fact Orders'[Order ID] )
    VAR ChosenOrder =
        SELECTEDVALUE ( 'Orders for slicer'[Order ID] )
    VAR RelatedOrders =
        CALCULATETABLE ( VALUES ( Links[Linked To] ), Links[Order ID] = ChosenOrder )
    VAR Result =
        IF ( CurrentOrder = ChosenOrder || CurrentOrder IN RelatedOrders, 1 )
    RETURN
        Result
    

    Add this measure as a filter to the matrix, to only show when the value is 1. Use the order ID from the fact table in the matrix.