cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AdamGill
Resolver I
Resolver I

Field Calculation Anomaly???

This is so weird! I have a Field with a Default Formula, which works perfectly:

"$"&DataCardValue74_1*10000*.7&".00"

- this correctly displays $14000 as the Value

BUT if I update the formula to change a single digit in one of the multipliers:

"$"&DataCardValue74_1*10500*.7&".00"

- this displays nothing as the Value - and there are no errors on the Formula!

The parameters and all of the Properties of the Field have remained the same - all I did was changed a single digit - but it refuses to display. I extended the box in case the number was too big to be displayed without some sort of text wrap but that wasn't the fault.

Has anyone come across this before?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

...as a workaround;

"$"&(DataCardValue74_1*10000*7/10)&".00"

Obviously not ideal - but it works!

View solution in original post

6 REPLIES 6
AdamGill
Resolver I
Resolver I

PS - before someone suggests paranthesis....

"$"&(DataCardValue74_1*10000*.7)&".00" works the same

"$"&(DataCardValue74_1*10500*.7)&".00" does not work!

...as a workaround;

"$"&(DataCardValue74_1*10000*7/10)&".00"

Obviously not ideal - but it works!

View solution in original post

Mr-Dang-MSFT
Power Apps
Power Apps

Hi @AdamGill,

Can you share what you have inputted into DataCardValue74_1? What type of control is it? Text input? Dropdown?

It's very important to understanding what you're experiencing.

 

I also notice you are manually inserting $ and cents. 

 

Can you try this:

 

Text(Value(DataCardValue74_1.Text)*10500*.7,"$#,##0.00")

Here, I'm assuming DataCardValue74_1 is a text input box (see my first question). Because it is text, I convert its text into a value for the calculation. I perform the multiplication. Note that I specifically call out the Text property of DataCardValue74_1 as a best practice even if I do not need to.

 

Then I use the Text() function to format the result of the multiplication to include a dollar sign in front, a comma past the 3rd whole digit, and two decimals for cents.

 

If no value comes out of the calculation, it will at least result in $0.00 because I formatted it that way.

 

Let me know what comes out with some screenshots.

Brian

Brian,

I applied a workaround, marked as the solution in this thread.

Adam

@AdamGill, I'm glad you got it working. Though I would highly encourage you to use the Text() function when formatting a number in the way that you want. 

 

Suppose you have negative and positive numbers to be formatted. Your existing solution would work for positive numbers. But if you have a negative number, it would appear with the negative sign inside like this because the concatenation is literal (left to right):

$-12345.00

Using the Text function I recommended, the negative sign appears outside and with commas and decimal places where you designate:

-$12,345.00

The dollar sign, comma, and decimal are understood in the context of the Text() function. But when concatenating them individually, there's no context that you're working with numbers--they would just be treated as strings.

I needed to find a way to encapsulate the pure number in a SharePoint Data Row which sits behind this Form equation because I use that in a number of math equations. In this instance I needed to display that pure number as currency, hence my formatting. The number will never be negative, so I did not need to take that into consideration. The part that concerns me the most is that the math engine behind PowerApps failed on a simple task, as explained in my original post!

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (60,905)