cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
AdamGill
Level 8

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
AdamGill
Level 8

Re: Field Calculation Anomaly???

...as a workaround;

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

Obviously not ideal - but it works!

View solution in original post

6 REPLIES 6
AdamGill
Level 8

Re: Field Calculation Anomaly???

PS - before someone suggests paranthesis....

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

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

AdamGill
Level 8

Re: Field Calculation Anomaly???

...as a workaround;

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

Obviously not ideal - but it works!

View solution in original post

PowerApps Staff Mr-Dang-MSFT
PowerApps Staff

Re: Field Calculation Anomaly???

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

AdamGill
Level 8

Re: Field Calculation Anomaly???

Brian,

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

Adam

PowerApps Staff Mr-Dang-MSFT
PowerApps Staff

Re: Field Calculation Anomaly???

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

AdamGill
Level 8

Re: Field Calculation Anomaly???

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
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 362 members 6,028 guests
Please welcome our newest community members: