This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
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.
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 37 | |
| 37 | |
| 31 | |
| 22 | |
| 15 |
| User | Count |
|---|---|
| 76 | |
| 59 | |
| 31 | |
| 31 | |
| 25 |