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