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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Fali324
Helper II
Helper II

Finding the minimum value which isn't 0

Hi,

 

I am trying to create a measure where it comes back with the lowest value which isn't 0.

 

If the dataset it 0,0,1,4,5,7,8, it should return 1 rather than 0.

 

I have tried COALESCE function but for some reason it doesn't allow me the select the data column.

 

Any help is much appreciated.

 

Thanks,

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

3 REPLIES 3
Ahmedx
Super User
Super User

pls try thjis

Screenshot_2.png

Ahmedx
Super User
Super User

pls try this
M1= MINX(FILTER(ALL('yourtable'),'yourtable'[Value]>0),'yourtable'[Value])
OR
M1= MINX(FILTER(ALL('yourtable'),'yourtable'[Value]<>0),'yourtable'[Value])

Syk
Super User
Super User

The Coalesce function only gets you the first non-blank value. Since 0 is not blank, it will return 0.

You can try something like 

First non-zero = calculate(MIN(table[column]),table[column]>0)

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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