Forum Discussion
Mat42
4 years agoResolver I
Max/Min Calculated Column
This is either going to be easy or horribly complicated. Let's say I ave a simple table of data: Name Date Dave 01/01/2021 Dave 01/01/2021 Dave 02/02/2019 Dave 01/01/2021 ...
- 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].
Mat42
4 years agoResolver I
Thanks for the replies, guys, that's really helpful.
I should have said that it needs to be created in Power Query as this is for a dataflow. Can this be replicated in M?