Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
Hi,
Here is what I have and want to achieve:
1) I have a table with a category column
2) Then I have multiple slicers related to each category in the category column
3) Now I want to write a Measure which is like : If user selects anything from Category A slicer then the Measure calculates a formula and only updates that particular row.
4) Now when the user selects anything from Category B slicer then the Measure calculates a formula and only updates that particular row.
This is what I tried :
Measure = SWITCH(
TRUE(),
[Category_A_selection]<>0,CALCULATE([Category_A_formula],'Sample Data'[Category]="Category A"),
[Category_B_selection]<>0,CALCULATE([Category_B_formula],'Sample Data'[Category]="Category B"), sum('Sample Data'[another_column]))
The problem with this it only shows the result in the Category A measure and nothing comes up in Category B Measure. Also whatever is selected in Category A slicer that value only shows up in Category B slicer.
Hi @Anonymous ,
I am not sure if I understood your question correctly. My output is that if the value in the slicer is not 0, then calculate value for category A and category B.
Measure =
VAR A =
CALCULATE (
[Category_A_formula],
FILTER ( 'Sample Data', 'Sample Data'[Category] = "Category A" )
)
VAR B =
CALCULATE (
[Category_B_formula],
FILTER ( 'Sample Data', 'Sample Data'[Category] = "Category B" )
)
RETURN
SWITCH (
TRUE (),
[Category_A_selection] <> 0
&& [Category_B_selection] <> 0, A + B,
[Category_A_selection] <> 0, A,
[Category_B_selection] <> 0, B,
SUM ( 'Sample Data'[another_column] )
)
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , I think you need two slicers on same column try
Compare Categorical Data Using Slicers - Compare two Brands: https://youtu.be/exN4nTewgbc
Thanks @amitchandak for sharing the video link. Very well explained. In the video you are adding the measures as different columns in the table. I need to have one Measure which calculates for each row based on what category it is and what slicer is selected.
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.
| User | Count |
|---|---|
| 22 | |
| 20 | |
| 14 | |
| 13 | |
| 13 |
| User | Count |
|---|---|
| 62 | |
| 40 | |
| 39 | |
| 39 | |
| 38 |