cancel
Showing results for
Did you mean:
Helper III

## How to Prevent Formula from Calculating If Not number

Good day,

I have a formula looking at multiple, single line text.  ( i need single line text to allow user to input some values sometimes with text due to unit inconsistencies)

I would like the formula NOT to calculate when there a text or if it is blank. Or basically only calculate when all are Numbers.

I am trying to use !isnumeric but it seems not to be working.

Any advise is appreciated.

Thank you.

Edit - it seems isnumeric is something working, will reply if i got it to work

1 ACCEPTED SOLUTION

Accepted Solutions
Most Valuable Professional

Yes you can use IsNumeric

If you want sometimes to try and convert Text to Number initially and then fall back to not calculating if it fail, try using Value (this gives Blank() if the conversion fails, which can be checked by IsBlank)

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-value

Example - If someone enters 12.34%, Value("12.34%") converts it to 0.1234 instead of having to manually check for or handle this in some other way.

See if above helps in case.

2 REPLIES 2
Most Valuable Professional

Yes you can use IsNumeric

If you want sometimes to try and convert Text to Number initially and then fall back to not calculating if it fail, try using Value (this gives Blank() if the conversion fails, which can be checked by IsBlank)

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-value

Example - If someone enters 12.34%, Value("12.34%") converts it to 0.1234 instead of having to manually check for or handle this in some other way.

See if above helps in case.

Post Prodigy

In my case i have this formula,

Set(
vary,
Round(
If Error(
((DataCardValue159.Text - DataCardValue160.Text) / DataCardValue159.Text),
0
) * 100,
2
)
)

when any one of the data cards is blank I don't want the formula to calculate. But when (DataCardValue159.Text) is not blank and (DataCardValue160.Text) is blank its calculating the formula.  I tried using If conditions, but it seems not to be working.

Any help is greatly appreciated.

Announcements

#### Celebrating the May Super User of the Month: Laurens Martens

@LaurensM  is an exceptional contributor to the Power Platform Community. Super Users like Laurens inspire others through their example, encouragement, and active participation. We are excited to celebrated Laurens as our Super User of the Month for May 2024.   Consistent Engagement:  He consistently engages with the community by answering forum questions, sharing insights, and providing solutions. Laurens dedication helps other users find answers and overcome challenges.   Community Expertise: As a Super User, Laurens plays a crucial role in maintaining a knowledge sharing environment. Always ensuring a positive experience for everyone.   Leadership: He shares valuable insights on community growth, engagement, and future trends. Their contributions help shape the Power Platform Community.   Congratulations, Laurens Martens, for your outstanding work! Keep inspiring others and making a difference in the community!   Keep up the fantastic work!

#### Announcing Power Apps Copilot Cookbook Gallery

We are excited to share that the all-new Copilot Cookbook Gallery for Power Apps is now available in the Power Apps Community, full of tips and tricks on how to best use Microsoft Copilot as you develop and create in Power Apps. The new Copilot Cookbook is your go-to resource when you need inspiration--or when you're stuck--and aren't sure how to best partner with Copilot while creating apps.   Whether you're looking for the best prompts or just want to know about responsible AI use, visit Copilot Cookbook for regular updates you can rely on--while also serving up some of your greatest tips and tricks for the Community. Check Out the new Copilot Cookbook for Power Apps today: Copilot Cookbook - Power Platform Community.  We can't wait to see what you "cook" up!