Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello,
I am trying to create a column that picks out the minimum value from a number of columns.
I have posted a table below with my desired outcome
Can someone advise?
Many Thanks
ID | A | B | C | D | E | F | G | Desired Column |
36185098 | 19.98 | 39 | 14.7 | 0 | 0 | 0 | 0 | C |
36855167 | 22 | 29.5 | 18 | 0 | 18 | 17.8 | 18.5 | F |
34938430 | 25.98 | 27.98 | 17.8 | 0 | 0 | 20.5 | 17 | G |
38001554 | 23.6 | 27.3 | 16.2 | 8 | 16.2 | 0 | 0 | D |
32315810 | 0 | 27.1 | 16.7 | 0 | 0 | 16.5 | 16.1 | G |
32125239 | 22.1 | 27 | 16.4 | 0 | 0 | 16.1 | 17.8 | F |
Solved! Go to Solution.
After unpivoting your Letter Columns, you can use following MEASURE to get the desired Output
DesiredResult = VAR MinValue = CALCULATE ( MIN ( TableName[Value] ), TableName[Value] <> 0 ) RETURN CONCATENATEX ( FILTER ( TableName, TableName[Value] = MinValue ), TableName[Attribute], ", " )
Easiest thing to do would be to unpivot your letter columns. At that point, the problem is trivial.
make sure to specify that you dont care about zeros, as in your dataset, the lowest value is zero, even though its your outcome in the sample data specifies you want the lowest value that is greater than zero.
After unpivoting your Letter Columns, you can use following MEASURE to get the desired Output
DesiredResult = VAR MinValue = CALCULATE ( MIN ( TableName[Value] ), TableName[Value] <> 0 ) RETURN CONCATENATEX ( FILTER ( TableName, TableName[Value] = MinValue ), TableName[Attribute], ", " )
With your sample data