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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

How to make Ratio display 100 when AVE_AMT = 0 ?

Hi All

 
My below expression working fine :-
 
_RATIO = DIVIDE (INVC[Amt_On Hand],INVC[AVE_AMT])
 
May i know how to make _RATIO display 100 when AVE_AMT = 0 ?
 
Now it display Null value.
Paulyeo11_0-1610008790501.png

 

 
 
My PBI file :-
 
 
Paul Yeo 
 
 
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous ,

try like

DIVIDE (INVC[Amt_On Hand],INVC[AVE_AMT],1)

or

DIVIDE (INVC[Amt_On Hand],INVC[AVE_AMT],100)

 

or

if(INVC[AVE_AMT] =0, 1,DIVIDE (INVC[Amt_On Hand],INVC[AVE_AMT]))

or

if(INVC[AVE_AMT] =0, 100,DIVIDE (INVC[Amt_On Hand],INVC[AVE_AMT]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous ,

try like

DIVIDE (INVC[Amt_On Hand],INVC[AVE_AMT],1)

or

DIVIDE (INVC[Amt_On Hand],INVC[AVE_AMT],100)

 

or

if(INVC[AVE_AMT] =0, 1,DIVIDE (INVC[Amt_On Hand],INVC[AVE_AMT]))

or

if(INVC[AVE_AMT] =0, 100,DIVIDE (INVC[Amt_On Hand],INVC[AVE_AMT]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
MFelix
Super User
Super User

Hi @Anonymous ,

 

Theres is an optional argument on the divide function that is alternate result that is given when you have a null or error in this case change your measure to:

 

_RATIO = DIVIDE (INVC[Amt_On Hand];INVC[AVE_AMT]; 100)

MFelix_0-1610009647921.png

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português





Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.