Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join 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.

Reply
Anonymous
Not applicable

Using multiple slicers in a Measure

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.

3 REPLIES 3
v-kkf-msft
Community Support
Community Support

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] )
    )

vkkfmsft_0-1652856635707.png

vkkfmsft_1-1652856650085.png

 

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.

amitchandak
Super User
Super User

@Anonymous , I think you need two slicers on same column try

 

Compare Categorical Data Using Slicers - Compare two Brands: https://youtu.be/exN4nTewgbc

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

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.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.