Forum Discussion
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
and here is a text sample
| userTypeName | QTY | scanAction | created at | Product Type | Unit Price |
| manufacturer | 1859 | IN Warehouse | 2024-05-22T17:22:09.187Z | Lap Top | 6 |
| Shop | 35 | Shop | 2024-05-22T17:22:08.117Z | Lap Top | 6 |
| Shop | 3 | Shop | 2024-05-22T17:12:17.947Z | Headphones | 292 |
| Shop | 35 | Shop | 2024-05-22T16:58:37.601Z | Lap Top | 6 |
| manufacturer | 8 | Sell Out | 2024-05-22T16:26:11.257Z | Computer | 385 |
| Seller | 8 | Sell Out | 2024-05-22T16:26:11.257Z | Computer | 385 |
| manufacturer | 8 | IN Warehouse | 2024-05-22T16:25:17.019Z | Computer | 385 |
| Seller | 8 | IN Warehouse | 2024-05-22T16:25:17.019Z | Computer | 385 |
| Seller | 9 | Sell Out | 2024-05-22T16:21:30.672Z | Headphones | 188 |
| manufacturer | 11 | Sell Out | 2024-05-22T16:21:30.672Z | Headphones | 188 |
| manufacturer | 11 | IN Warehouse | 2024-05-22T16:21:22.361Z | Headphones | 188 |
| Seller | 9 | IN Warehouse | 2024-05-22T16:21:22.361Z | Headphones | 188 |
| manufacturer | 10 | Sell Out | 2024-05-22T16:20:40.613Z | Headphones | 292 |
- Anonymous2 years ago
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 )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() )Best Regards,
Adamk KongIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1 Reply
- AnonymousNot 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 )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() )Best Regards,
Adamk KongIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.