Power BI: find the minimum or maximum value
I will explain how to find the minimum/maximum value for a column but also in a list of number in a cell. Let’s start for a column, to find the minimum, I will use this formula:
MINX(FILTER(ALL('table'),'table'[argument]=MIN('table'[argument])),'table'[argument])
And for the maximum:
MAXX(FILTER(ALL('table'),'table'[argument]=MAX('table'[argument])),'table'[argument])
NOTE: change “table” and “argument” by yours
Let’s take an example, I have this data:
And I want to get the minimum and maximum of “number”:
Alternatively, I can use measures to sort with another condition, for instance, the “opened” column:
CALCULATE(MIN('table'[argument1]),'table'[argument2]=MIN('table'[argument2]))
NOTE: for the maximum value, change MIN by MAX
As an extra, to extract the number of the “number” column, I will use this formula:
RIGHT('table'[argument],LEN('table'[argument])-(SEARCH("value",'table'[argument])))
NOTE:
- Replace value by yours. In my example, replace “C” which is the last letter of INC
- Don’t forget to change the “data type” from “text” to “whole number”
To find the minimum value for a specific group:
CALCULATE(MIN('table'[argument1]),ALLEXCEPT('table','table'[argument2]))
NOTE: for the maximum value, change MIN by MAX
To find the lower number in a list of values, I will have to go to the Power Query Editor then “add column -> custom column”:
Put this formula:
List.Min(List.Transform(Text.Split([argument]," "),each Number.From(_)))
NOTE:
- If numbers are separated by a coma for instance, change " " by ","
- For the maximum, change “List.Min” by “List.Max”
- If the list may contain a text, to ignore errors, put “try ... otherwise null”
You may be interested to read Power BI: extract numbers and/or text.
Interesting Topics
-
Be successfully certified ITIL 4 Managing Professional
Study, study and study, I couldn’t be successfully certified without studying it, if you are interested...
-
Be successfully certified ITIL 4 Strategic Leader
With my ITIL 4 Managing Professional certification (ITIL MP) in the pocket, it was time to go for the...
-
Hide visual and change background color based on selection
Some small tricks to customize the background colour of a text box...
-
Stacked and clustered column chart or double stacked column chart
In excel, I use a lot the combination of clustered and stacked chart...
-
Refresh Power BI
From the Power BI Service, I can set refresh but, for instance, there is no option to do it monthly or each time a change is made...
-
Power BI alerts to be sent by email from an excel file based on condition
I will explain how to send a list of emails from an excel file after creating alerts...






