cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kgray15
Frequent Visitor

convert sum of grouped values to currency

Good day PA community,

 

I have what I hope to be a pretty simple question with a simple solution.  I have built an application that is grouping a number of records from an SQL DB.  I need several amounts from that DB and convert them to currency.  This is functional in other parts of my app but I cannot seem to get it to work when multiple records have been grouped.  See the screenshots below.  The first is where it is not working as intended on a grouped value. The second where it is on an ungrouped value.  

I think it may have something to do with the fact that the values are no longer recognized as numbers once they are grouped but I'm not really sure.

 

Any insight would be greatly appreciated.

Kgray15_0-1600379828396.png

Kgray15_1-1600380133944.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

@Kgray15 

I'm not sure why you are using the Value function in there.  If those amounts are numbers, there is not a need.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

5 REPLIES 5
RandyHayes
Super User
Super User

@Kgray15 

You're actually missing the Text function on your formula.

I believe you want Text(Sum(ThisItem.Batches, PremiumAmount), "$#,###,##0.00")

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hey @RandyHayes , I've tried that as well. Still no luck unfortunately.

Kgray15_0-1600382210593.png

 

@Kgray15 

I'm not sure why you are using the Value function in there.  If those amounts are numbers, there is not a need.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes, Looks like that alone solved it. Removed the value function and it's working just fine.

 

I had read somewhere that once you use the GroupBy function, number values are considered text.  I was trying to convert it back to a number using the Value function but that was clearly not required.

 

Text(Sum(ThisItem.Batches,PremiumAmount), "[$-en-US]$###,####.00") works.

Good deal.  

No, grouping does not change data types.  If they are numbers they will be numbers.

Glad to help.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

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 (1,753)