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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply

Filter Slicer VALUES

Hi All,

 

I need to filter the values from the slicer, so if I select the seller only shows the sell out values & when I choose the manufacuter show the in warehouse values & when I choose the shop, keeps the shop values 

Is it possible to do this?

 

Note: I have many other charts in the same page all filtered by the same slicer 

Asmaaelsheikh_0-1716459507858.png

and here is a text sample

 

userTypeNameQTYscanActioncreated atProduct TypeUnit Price
manufacturer1859IN Warehouse2024-05-22T17:22:09.187ZLap Top6
Shop35Shop2024-05-22T17:22:08.117ZLap Top6
Shop3Shop2024-05-22T17:12:17.947ZHeadphones292
Shop35Shop2024-05-22T16:58:37.601ZLap Top6
manufacturer8Sell Out2024-05-22T16:26:11.257ZComputer385
Seller8Sell Out2024-05-22T16:26:11.257ZComputer385
manufacturer8IN Warehouse2024-05-22T16:25:17.019ZComputer385
Seller8IN Warehouse2024-05-22T16:25:17.019ZComputer385
Seller9Sell Out2024-05-22T16:21:30.672ZHeadphones188
manufacturer11Sell Out2024-05-22T16:21:30.672ZHeadphones188
manufacturer11IN Warehouse2024-05-22T16:21:22.361ZHeadphones188
Seller9IN Warehouse2024-05-22T16:21:22.361ZHeadphones188
manufacturer10Sell Out2024-05-22T16:20:40.613ZHeadphones292
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Asmaa-elsheikh ,

 

Create a calculated column to identify which rows should be displayed based on the userTypeName selection.

DisplayFlag = 
SWITCH(
    TRUE(),
    [userTypeName] = "Seller" && [scanAction] = "Sell Out", 1,
    [userTypeName] = "Manufacturer" && [scanAction] = "IN Warehouse", 1,
    [userTypeName] = "Shop", 1,
    0
)

vkongfanfmsft_0-1716517496290.png

Then create measures that dynamically return values based on the slicer selection.

FilteredScanAction = 
VAR SelectedUserType = SELECTEDVALUE('Table'[userTypeName])
RETURN
SWITCH(
    TRUE(),
    SelectedUserType = "Seller", CALCULATE(SUM('Table'[QTY]), 'Table'[scanAction] = "Sell Out"),
    SelectedUserType = "Manufacturer", CALCULATE(SUM('Table'[QTY]), 'Table'[scanAction] = "IN Warehouse"),
    SelectedUserType = "Shop", CALCULATE(SUM('Table'[QTY]), 'Table'[scanAction] = "Shop"),
    BLANK()
)

 

vkongfanfmsft_1-1716517557100.png

Best Regards,
Adamk Kong

 

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

1 REPLY 1
Anonymous
Not applicable

Hi @Asmaa-elsheikh ,

 

Create a calculated column to identify which rows should be displayed based on the userTypeName selection.

DisplayFlag = 
SWITCH(
    TRUE(),
    [userTypeName] = "Seller" && [scanAction] = "Sell Out", 1,
    [userTypeName] = "Manufacturer" && [scanAction] = "IN Warehouse", 1,
    [userTypeName] = "Shop", 1,
    0
)

vkongfanfmsft_0-1716517496290.png

Then create measures that dynamically return values based on the slicer selection.

FilteredScanAction = 
VAR SelectedUserType = SELECTEDVALUE('Table'[userTypeName])
RETURN
SWITCH(
    TRUE(),
    SelectedUserType = "Seller", CALCULATE(SUM('Table'[QTY]), 'Table'[scanAction] = "Sell Out"),
    SelectedUserType = "Manufacturer", CALCULATE(SUM('Table'[QTY]), 'Table'[scanAction] = "IN Warehouse"),
    SelectedUserType = "Shop", CALCULATE(SUM('Table'[QTY]), 'Table'[scanAction] = "Shop"),
    BLANK()
)

 

vkongfanfmsft_1-1716517557100.png

Best Regards,
Adamk Kong

 

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.