cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
ShaikSayyad
Level: Powered On

Formula for ratio calculation

Hi Mates,

I have two labels named as A and B then I want to display ratio in C label as 100% if  A/B = 0/0.

I can able to get the value of label_C  if A/B <> 0/0 with below formula

Round((Value(Label1_76.Text)/(Label1_91.Text))*100,1 )& "%"

 

Please help me to get C label as 100% if  A/B = 0/0.

 

Thanks in Advance.

1 ACCEPTED SOLUTION

Accepted Solutions
K-A-R-L
Level 10

Re: Formula for ratio calculation

Hi @ShaikSayyad ,

Can you please try the code below:

If(
    Round(
        Value(Label1_76.Text) / Value(Label1_91.Text) * 100,
        1
    ) <= 0,
    100 & "%",
    Round(
        Value(Label1_76.Text) / Value(Label1_91.Text) * 100,
        1
    ) & "%"
)

----------------------------------------------------------------------------
Thanks,
K-A-R-L


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If you thought this post was helpful, please give it a Thumbs Up.

1 REPLY 1
K-A-R-L
Level 10

Re: Formula for ratio calculation

Hi @ShaikSayyad ,

Can you please try the code below:

If(
    Round(
        Value(Label1_76.Text) / Value(Label1_91.Text) * 100,
        1
    ) <= 0,
    100 & "%",
    Round(
        Value(Label1_76.Text) / Value(Label1_91.Text) * 100,
        1
    ) & "%"
)

----------------------------------------------------------------------------
Thanks,
K-A-R-L


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If you thought this post was helpful, please give it a Thumbs Up.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Users Online
Currently online: 214 members 4,537 guests
Please welcome our newest community members: