Forum Discussion
derekmalag
4 years agoNew Member
Calculated Colum: Get MIN value from a filtered table
Hi, I'm stuck in something that I think it is simple but I can't make it work so I'm pretty sure I'm doing something incorrectly but don;t know what so would appreciatte any light on it. I have a...
- 4 years ago
derekmalag Here are a couple different ways:
MIN_VALUE = CALCULATE ( MIN('MyTable'[Total_Value]), FILTER('MyTable',[Model]=EARLIER('MyTable'[Model])) ) MIN_VALUE = VAR __Model = [Model] RETURN CALCULATE ( MIN('MyTable'[Total_Value]), FILTER('MyTable',[Model]=__Model) )
derekmalag
4 years agoNew Member
amazing Greg_Deckler , I've used the [EARLIER] option and it works so not going through the second :). Assuming not, but just to be sure, if there is any consideration in performance between these two options?
Many thanks again
AlexisOlson
Super User
4 years agoderekmalag If you're concerned about performance, then you should filter on columns rather than tables whenever possible.
I'd probably write it like this instead:
MIN_VALUE =
CALCULATE (
MIN ( 'MyTable'[Total_Value] ),
ALLEXCEPT ( 'MyTable', 'MyTable'[Model] )
)