Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
rjg2g11
Advocate I
Advocate I

Minimum Value across multiple columns

 

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

 

 

IDABCDEFGDesired Column
3618509819.983914.70000C
368551672229.51801817.818.5F
3493843025.9827.9817.80020.517G
3800155423.627.316.2816.200D
32315810027.116.70016.516.1G
3212523922.12716.40016.117.8F
1 ACCEPTED SOLUTION

@rjg2g11

 

 

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],
        ", "
    )

Regards
Zubair

Please try my custom visuals

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

Easiest thing to do would be to unpivot your letter columns. At that point, the problem is trivial.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.

@rjg2g11

 

 

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],
        ", "
    )

Regards
Zubair

Please try my custom visuals

@rjg2g11

 

See the attached file here

With your sample data

 

 

6001.png


Regards
Zubair

Please try my custom visuals

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.