Forum Discussion
How to filter a slicer dynamically based on selection on field parameter
- 2 months ago
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
The approach above works when the measure can be evaluated at the Department level and returns Blank/non-Blank consistently for each department. If your measures use different filter contexts or more complex logic, the solution may need to be adapted to the specific measure definitions rather than using a generic pattern.
Could you share -
- A small sample of the data model (relevant tables/relationships)
- The Field Parameter definition
- Simplified versions of the measures being used
With a sample, it would be easier to determine whether the Department slicer can be filtered directly from the measures or whether an alternative approach is needed.
Hey, here is a sample file, so I want the 'Parameter' slicer to filter the 'DepName' slicer.
Cannot attach files so heres a link:
- Rupa012 months ago
Solution Sage
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- Petja2 months ago
Advocate II
works beautifully, thank you!