Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. 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.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.