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
Petja, check out below eaxmple using sample data -
Sample Data -
Measures Parameter interacting dynamically with Department Slicer -
Measure 1 is SUM(Sales) and Measure 2 is SUM(Revenue)
💡 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
Hi,
Thanks, I guess this will work if I create a summary table. But right now my measures are based on different filter contexts and not different columns and creating multiple dax calculated columns will surely make the report sluggish.
- Rupa012 months ago
Solution Sage
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.
- Petja2 months ago
Advocate II
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