Forum Discussion
Different slicers by variable category
Hi everyone,
I'm looking for help for the following problem.
Let's say I have this input data:
| ID | Category | Var1 |
| 1 | A | 925 |
| 2 | B | 927 |
| 3 | A | 950 |
| 4 | A | 996 |
| 5 | C | 938 |
| 6 | B | 907 |
| 7 | C | 910 |
| 8 | A | 969 |
| 9 | C | 913 |
| 10 | C | 961 |
| 11 | A | 1000 |
For this input I get the following summary table with the average of Var1 by each category.
| Category | Count | Var1 Avg |
| A | 5 | 968 |
| B | 2 | 917 |
| C | 4 | 931 |
Now let's say I want to add a "between" slicer for values of Var1 for Category A, so that the user can control which subset of rows should count for the average. If my slicer is set to between 945 and 999, as such
I expect to have the following resulting summary table, as only the rows of Category A are affected:
| Category | Count | Var1 Avg |
| A | 3 | 972 |
| B | 2 | 917 |
| C | 4 | 931 |
Can you help me define the necessary aux columns and measures (or let me know if this can't be done in PowerBI)? I've tried filtering the slicers in the filter pane and creating separate one-column tables for each category, but am unable to relate them to the original table. My end goal is to have 3 slicers, each for categories A, B and C.
Sorry if this question has already been answered, I couldn't find a post describing this problem but if you could point me in the right direction I would appreciate it.
2 Replies
- lbendlin
Super User
I expect to have the following resulting summary table, as only the rows of Category A are affected:That's not how Power BI works. When you apply filters they work on all items, not only the one you "are thinking of".
Here's an example of how to observe the What-if parameter boundaries:
- Ashish_Mathur
Super User