Forum Discussion
Max/Min Calculated Column
- 4 years ago
Your calculated column needs to look like:
Min Date = CALCULATE ( MIN ( Person[Date] ), ALLEXCEPT( Person, Person[Name] ) )
If you just did MIN on it's own it would find the minimum date in the whole column.
CALCULATE forces a context transition that moves all the columns in the current row into the filter context.
However CALCULATE ( MIN ( Person[Date] ) ) will just return the date of the current row because CALCULATE has included the date column in the filter.The solution above tells calculate to remove the filters from everything apart from Person[Name].
Your calculated column needs to look like:
Min Date =
CALCULATE (
MIN ( Person[Date] ),
ALLEXCEPT( Person, Person[Name] )
)
If you just did MIN on it's own it would find the minimum date in the whole column.
CALCULATE forces a context transition that moves all the columns in the current row into the filter context.
However CALCULATE ( MIN ( Person[Date] ) ) will just return the date of the current row because CALCULATE has included the date column in the filter.
The solution above tells calculate to remove the filters from everything apart from Person[Name].