Forum Discussion
Dynamic Filter on Calculatetable (Doesn't Work)
- Anonymous2 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 resultRegards,
Xiaoxin Sheng
thank you for your advice.
But when i see the DAX, the return of result is quantity.
What if the return is list of data ? Do you have any idea ?
Because i want show detail of data..
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