Forum Discussion
ghaines
Resolver I
4 years agoCALCULATE filters as filter function vs boolean expression
I just fixed an issue and I don't understand how. The brief was a unit count above and below our theoretical "minimum price" for a new order. I used a simple boolean in a CALCULATE function: ...
amitchandak
Super User
4 years agoghaines , I think this one should use allselected
VAR PlatinumPrice = CALCULATE(MIN('Pricing at Divisions'[ITEM_UNIT_PRICE]),
FILTER(allselected('Pricing at Divisions'), 'Pricing at Divisions'[ITEM_ID] = HighestIndexInItemType)ghaines
Resolver I
4 years agoamitchandak Thanks for your reply.
It didn't fix the measure when the filters were changed back to simple booleans.
In any case, whatever that intermediate variable was evaluating to, it doesn't seem to have any effect on the return value.
The restriction Net_Amount >= PlatinumPrice returned all transactions in the context
The restriction Net_Amount < PlatinumPrice returned all transactions in the context
The value of PlatinumPrice is immaterial. There is a mistake contained somewhere inside the Switch statement, and probably within a calculate function, since the default value of the switch was not returned except where appropriate.