Forum Discussion

AlexAuto2026's avatar
AlexAuto2026
New Member
3 months ago
Solved

Dynamic filtering between two tables

Hello, I have a question about dynamic filtering between two tables that do not have a direct relationship. The requirement is: when using a hierarchical slicer (default slicer with levels), the “Us...
  • johnt75's avatar
    3 months ago

    You can create a measure like

    Employee is visible = 
    VAR CurrentCode = SELECTEDVALUE( User[Mã Bộ Phận (Ngẫu nhiên các Level)] )
    VAR Result =
        SWITCH(
            SELECTEDVALUE( User[Cấp độ mã] ),
            "Level 2",
            IF( CurrentCode IN VALUES( Org[Level 2 Code] ), 1 ),
            "Level 3",
            IF( CurrentCode IN VALUES( Org[Level 3 Code] ), 1 ),
            "Level 4",
            IF( CurrentCode IN VALUES( Org[Level 4 Code] ), 1 )
        )
    RETURN Result

    and use this as a filter on the user slicer, set to show only when the value is 1.