cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
grapejuice
Helper III
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

@grapejuice 

 

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.

View solution in original post

2 REPLIES 2

@grapejuice 

 

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.

Hi @poweractivate ,

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.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,907)