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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

If selection based on slicer

Hi Everyone,

I'm trying to figure this one out and as a newbie and knowing little with PowerBi I'm not sure where to start.

I want to create a measure that says that if the slicer that the user selects is "Shop A" then I want "table c" to show values for "ShopAB", else if the slicer is anything else other than "Shop A" eg "Shop B" I want "table c" to show values for "Shop B" and if the slicer selected is "Shop C", then "table c" should show "Shop C" etc...the only one that has to be any different is the first one...ie. If the slicer selection is "shop a", table c should show "shop ab"

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Anonymous ,

According to your description, I created an example of this. Hope this helps.

select-table.PNG

1. Create a Slicer Table which is independent of the other table. 

Slicer Table = VALUES(Shop[Shop])

Or, you can just use "Enter Data".

select-slicert.PNG

select-slicer.PNG

2. Create a measure.

Value Measure = 
VAR SelectedValue =
    SELECTEDVALUE ( 'Slicer Table'[Shop] )
VAR CurrentValue =
    MAX ( Shop[Shop] )
RETURN
    IF (
        ISBLANK ( SelectedValue ),
        SUM ( Shop[Value] ),
        IF (
            SelectedValue = "A",
            CALCULATE (
                SUM ( Shop[Value] ),
                FILTER ( Shop, Shop[Shop] = "A" || Shop[Shop] = "B" )
            ),
            IF (
                SelectedValue = CurrentValue,
                CALCULATE ( SUM ( Shop[Value] ), FILTER ( Shop, Shop[Shop] = CurrentValue ) )
            )
        )
    )

Then, you can get this:

Selcet.gif

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Icey
Community Support
Community Support

Hi @Anonymous ,

According to your description, I created an example of this. Hope this helps.

select-table.PNG

1. Create a Slicer Table which is independent of the other table. 

Slicer Table = VALUES(Shop[Shop])

Or, you can just use "Enter Data".

select-slicert.PNG

select-slicer.PNG

2. Create a measure.

Value Measure = 
VAR SelectedValue =
    SELECTEDVALUE ( 'Slicer Table'[Shop] )
VAR CurrentValue =
    MAX ( Shop[Shop] )
RETURN
    IF (
        ISBLANK ( SelectedValue ),
        SUM ( Shop[Value] ),
        IF (
            SelectedValue = "A",
            CALCULATE (
                SUM ( Shop[Value] ),
                FILTER ( Shop, Shop[Shop] = "A" || Shop[Shop] = "B" )
            ),
            IF (
                SelectedValue = CurrentValue,
                CALCULATE ( SUM ( Shop[Value] ), FILTER ( Shop, Shop[Shop] = CurrentValue ) )
            )
        )
    )

Then, you can get this:

Selcet.gif

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

You can use the SELECTEDVALUE DAX formula to use which Shop is selected in your filter. 

Your dax formula would look something like 

yourMeasure = IF(SELECTEDVALUE('table'[SHOPNAME]) = "Shop A", ResultIfTrue, ResultIfNotTrue)

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors