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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Impactful Individual

## 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.

My PBI file :-

Paul Yeo

1 ACCEPTED SOLUTION
Super User

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

2 REPLIES 2
Super User

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

Super User

Hi @Paulyeo11 ,

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)``

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

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

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

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors