Forum Discussion

Lazuriii's avatar
Lazuriii
Frequent Visitor
2 years ago
Solved

Sales range by customer

Hi,   My problem is quite straightforward and I haven't been able to find a working solution to this. I want to create a slider slicer that allows the users to select the range of sales they want t...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Lazuriii,

    I'd like to suggest you create a disconnected table as source of slicer, then you can write a measure formula to check the aggregated value and return flag.

    flag =
    VAR selection =
        ALLSELECTED ( NewTable[Value] )
    VAR currSales =
        CALCULATE (
            SUM ( Table1[Sales] ),
            ALLSELECTED ( Table1 ),
            VALUES ( Table1[Customer] )
        )
    RETURN
        IF (
            currSales >= MINX ( selection, [Value] )
                && currSales <= MAXX ( selection, [Value] ),
            "Y",
            "N"
        )

    After these steps, you can use this measure formula on the table visual 'visual level filter' to filter records that match with flag.

    Regards,

    Xiaoxin Sheng