Forum Discussion

Petja's avatar
Petja
Icon for Advocate II rankAdvocate II
2 months ago
Solved

How to filter a slicer dynamically based on selection on field parameter

Hi,   I have a report where there are multiple different measures. The user can choose from field parameter slicer which measures they want to see. I also have a slicer for department, which uses a...
  • Rupa01's avatar
    Rupa01
    2 months ago

    Petja,

    Add below Measure (Show Department) and apply this as a visual filter to Department Slicer (DepName) -> Show Department = "1"

    Show Department = 
    VAR _SelectedMeasure =
        SELECTEDVALUE ( 'Parameter'[Parameter Fields] )
    
    RETURN
    SWITCH (
        TRUE(),
        _SelectedMeasure = NAMEOF([Calc1]),
        IF ( NOT ISBLANK ( [Calc1] ), 1 ),
        _SelectedMeasure = NAMEOF([Calc2]),
        IF ( NOT ISBLANK ( [Calc2] ), 1 ),
        1
    )

     Result - 

     

    💡 Helpful? Give a Kudos 👍 — keep the community growing
     Solved your issue? Mark as Solution ✔️ — help others find it faster

    Best regards,
    Rupasree Achari | BI & Fabric Analytics Engineer