Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Different slicers by variable category

Hi everyone,

 

I'm looking for help for the following problem.
Let's say I have this input data:

IDCategoryVar1
1A925
2B927
3A950
4A996
5C938
6B907
7C910
8A969
9C913
10C961
11A1000

 

For this input I get the following summary table with the average of Var1 by each category.

CategoryCountVar1 Avg
A5968
B2917
C4931

 

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:

CategoryCountVar1 Avg
A3972
B2917
C4931

 

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

  • 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: