# PowerQuery - Calculate MIN across multiple columns for each record



## DaveBlakeMAAT (Jan 21, 2019)

Hi

Firstly, I need to achieve the following within PowerQuery (shockingly my employer still uses Office 2010) and not a fan of PowerPivot in 2010 (too easy to break the model!).

In my PowerQuery I will be providing various rankings for based upon multiple conditional columns, what I then need to do is add a calculated column to return the Minimum value.

In Excel I would use =MIN(Column1, Column2, Column3).

Does anyone know if this is possible using a calculated column?

Regards

Dave


----------



## Misca (Jan 21, 2019)

Try

=List.Min({[Colunmn 1], [Colunmn 2], [Colunmn 3]})

You'll get the same formula without typing when you select the columns you're interested in and select the Minimum from the Statistics menu on the Add Column -tab in the Power Query window.

If you don't want the minimum value of each row but from the whole columns add another step where you group by a column where all the values are same (if you don't have one make one) and get the min of the List.Min -column.


----------



## DaveBlakeMAAT (Jan 21, 2019)

Well, I feel really dumb!!

Never used the Statistics button before, it is perfect for what I need.  My workloads normally involve groupings!

Many thanks


----------

