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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

DAX - find lowest value of three variables over 0

Hi,

 

I have created three variables that do a calculation and return a single value. I now need to figure out which of these thress is the lowest but over 0.

 

Let's say I have:

 

var No1 = 2 

var No2 = 0

var No3 = 6

 

I want to declare a variable that returns No1 in the above case as it is the lowest value out of the three that is over 0.

I'll need this variable for a calculation later on in my code.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I found a (very ugly) solution:

 

VAR lowestoverzerso =
MIN (
MIN ( IF ( No1 < 1, No2, No1), IF ( No2< 1, No1, No2 ) ),
IF (
No3 < 1,
MIN ( IF ( No1 < 1, No2, No1), IF ( No2< 1, No1, No2 ) ),
No3
)
)

View solution in original post

4 REPLIES 4
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous 

 

Something like this ..May be

 

var No1 = 2 
var No2 = 0
var No3 = 6
VAR lowest=MINX(Filter({No1,No2,No3},[Value]>0),[Value])
Anonymous
Not applicable

What is [Value] refering to in this formula?

@Anonymous 

 

When we create a table manually like { "a","b"}, the column name of the that table is "Value"

 

 

Anonymous
Not applicable

I found a (very ugly) solution:

 

VAR lowestoverzerso =
MIN (
MIN ( IF ( No1 < 1, No2, No1), IF ( No2< 1, No1, No2 ) ),
IF (
No3 < 1,
MIN ( IF ( No1 < 1, No2, No1), IF ( No2< 1, No1, No2 ) ),
No3
)
)

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors