Forum Discussion

Prihatama's avatar
Prihatama
Frequent Visitor
2 years ago
Solved

Dynamic Filter on Calculatetable (Doesn't Work)

Hay Everyone,   I have a problem when implement dynamic filter on calculatetable. Kindly please see below table. I have 2 Table. Table A with item name and date (YYYYMM) & Table B for slice...
  • Anonymous's avatar
    Anonymous
    2 years ago

    HI Prihatama,

    I think you can consider use IN operator, it can be used to compare value and list.

    The IN operator in DAX - SQLBI

    BTW, if you want to use large operator on the list, I think you only need to check the max one. If the current value large than the max value, it should also be suitable for the each of value in the list.

    formula =
    VAR selected =
        VALUES ( QuantityTable[Quantity] )
    VAR result =
        CALCULATE (
            SUM ( QuantityTable[Quantity] ),
            FILTER (
                ALLSELECTED ( QuantityTable ),
                QuantityTable[Quantity] >= MAXX ( selected, [Quantity] )
                    || QuantityTable[Quantity] IN selected
            )
        )
    RETURN
        result

    Regards,

    Xiaoxin Sheng