Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
HI all,
I have 8 measures:
("PriorDayUnits"), ("PriorWeekUnits"), ("PriorMonthUnits"), ("PriorYearUnits") under field parameters called Comparison1
and
To achieve this functionality in Power BI, you can create a dynamic measure slicer that changes based on the selection in the first slicer. Here's how you can do it step by step:
---
Step 1: Create a Field Parameter for the Second Slicer
1. Go to the **Modeling** tab in Power BI and click on **New Parameter** > **Fields**.
2. Create two field parameters:
- **Comparison1**: Includes `PriorDayUnits`, `PriorWeekUnits`, `PriorMonthUnits`, `PriorYearUnits`.
- **Comparison2**: Includes `PriorDayGrossSales`, `PriorWeekGrossSales`, `PriorMonthGrossSales`, `PriorYearGrossSales`.
---
Step 2: Create a Measure to Dynamically Switch Between Field Parameters**
Create a measure that dynamically selects the appropriate field parameter based on the selection in the first slicer (`TotalUnits` or `TotalGrossSales`).
```DAX
DynamicComparison =
SWITCH(
SELECTEDVALUE('DynamicMeasure'[Measure]), // Replace 'DynamicMeasure' with the name of your first slicer table
"TotalUnits", SELECTEDVALUE(Comparison1[Comparison1]),
"TotalGrossSales", SELECTEDVALUE(Comparison2[Comparison2])
)
```
---
Step 3: Create the Second Slicer**
1. Add a slicer to your report.
2. Bind the slicer to the **DynamicComparison** measure.
3. This slicer will now dynamically show either the `Comparison1` or `Comparison2` options based on the selection in the first slicer.
---
Step 4: Configure Interactions Between Slicers**
1. Ensure that the first slicer (`TotalUnits` or `TotalGrossSales`) is connected to the second slicer.
2. Use the **Edit Interactions** feature in Power BI to control how the first slicer filters the second slicer.
---
Step 5: Test the Dynamic Behavior**
- Select `TotalUnits` in the first slicer, and the second slicer should display `PriorDayUnits`, `PriorWeekUnits`, `PriorMonthUnits`, `PriorYearUnits`.
- Select `TotalGrossSales` in the first slicer, and the second slicer should display `PriorDayGrossSales`, `PriorWeekGrossSales`, `PriorMonthGrossSales`, `PriorYearGrossSales`.
Thank you so much for your thorough answer. I have a few more questions:
1. I created the second slicer, how do I bind it to the **DynamicComparison** measure (Step3 - #2)?
2. How do I connect the first slicer to the second one (step4 - #1)?
3. Where do I find the **Edit Interactions** feature in Power BI (step4 - #2)?
Hi @morani ,
We haven’t heard back from you regarding our previous response and wanted to check if your issue has been resolved.
If it has, please consider clicking “Accept Answer” and “Yes” if you found the response helpful.
If you still have any questions or need further assistance, feel free to let us know — we're happy to help!
Thank you!
Hi @morani ,
Has your issue been resolved? If a community member's response addressed your query, please consider marking it as Accepted Answer and click Yes if you found it helpful.
If you have any further questions, feel free to reach out.
Thank you for being a valued member of the Microsoft Fabric Community Forum!
Hi @morani ,
We haven’t heard back from you regarding our previous response and wanted to check if your issue has been resolved.
If it has, please consider clicking “Accept Answer” and “Yes” if you found the response helpful.
If you still have any questions or need further assistance, feel free to let us know — we're happy to help!
Thank you!
1. Make sure your first field parameter slicer is set to single select
2. delete all the other measures and create new measures that probe the SELECTEDVALUE of the first slicer and compute the required results.
Hi Ibendlin,
Thanks for your answer. Can you please let me know how to create the new measure that probe the SELECTEDVALUE of the first slicer (TotalUnits or TotalGrossSales) and will change a second slicer to display ("PriorDayUnits"), ("PriorWeekUnits"), ("PriorMonthUnits"), ("PriorYearUnits") if TotalUnits is selected in slicer 1 or ("PriorDayGrossSales"), ("PriorWeekGrossSales"), ("PriorMonthGrossSales"), ("PriorYearGrossSales") if TotalGrossSales is selected in slicer 1?
Use SELECTEDVALUE or VALUES. that will give you a single column table that you can use directly as a filter.
User | Count |
---|---|
15 | |
13 | |
12 | |
10 | |
10 |
User | Count |
---|---|
19 | |
15 | |
14 | |
11 | |
10 |