Forum Discussion

Asmaa-elsheikh's avatar
2 years ago
Solved

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

 

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
  • Anonymous's avatar
    Anonymous
    2 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 Kong

     

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

1 Reply

  • Anonymous's avatar
    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
    )
    

    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 Kong

     

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