Forum Discussion
Kristofferaabo
8 years agoHelper IV
MIN with Multiple Columns
Hi, I have problems getting the min value of dates returned across more than two columns. For instance columns C1, C2, C3, C4 and C5. How can I get a column or a measure returning the min va...
- 8 years ago
Hi Kristoffer
You could create a new column with DAX and use the MIN() function. As MIN() only takes 2 arguments you have to nest them:
MinValue = MIN(MIN(MIN(MIN(Demo[C1],Demo[C2]),Demo[C3]),Demo[C4]),Demo[C5])
There might be an easier way which I am not aware of.
Hope this helps!
JJ
- 8 years ago
You can use this calculated column
Column = VAR temp = { Table1[c1], Table1[c2], Table1[c3], Table1[c4], Table1[c5] } RETURN MINX ( Temp, [Value] )
DoubleJ
8 years agoSolution Supplier
Hi Kristoffer
You could create a new column with DAX and use the MIN() function. As MIN() only takes 2 arguments you have to nest them:
MinValue = MIN(MIN(MIN(MIN(Demo[C1],Demo[C2]),Demo[C3]),Demo[C4]),Demo[C5])
There might be an easier way which I am not aware of.
Hope this helps!
JJ
Zubair_Muhammad
8 years agoCommunity Champion
You can use this calculated column
Column =
VAR temp = { Table1[c1], Table1[c2], Table1[c3], Table1[c4], Table1[c5] }
RETURN
MINX ( Temp, [Value] )- Kristofferaabo8 years agoHelper IV
Hi Zubair_Muhammad I'm trying to use your formula on another dataset. I want to find the MIN value over 15 columns... but it seems that there is a restriction on the number of columns to put in the formula..?
- Anonymous5 years agoNot applicable
Thank you for the solution