cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
OsmandFernando Post Prodigy
Post Prodigy

How to roundup decimals and add comma in a chart data lable

Hi, 

 

I was able to create a collection and create a chart with your wonderful support. Now I have a challenge in the chart as it shows the values with many decimals. It is same in the collection a well. How to get rid of it?

 

 Capture.PNG

 

I need to show as e.g 900,000

 

Osmand

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: How to roundup decimals and add comma in a chart data lable

Hi @OsmandFernando ,

Based on the needs that you mentioned, I think the Text function could achieve your needs. Please consider take a try with the following workaround:

Set the Items property of the Pie Chart control to following:

AddColumns(
           LoanChartNew,
           "TotalOutstandingValue",
           Text(Value(Total_x0020_Outstanding), "##,###") // LoanValueColumn represents the column you use to display the loan value, e.g. 900000.000.. within your Pie Chart
)

Then set the Series property of your Pie Chart control to following:

TotalOutstandingValue

 

In addition, you could consider modify your ClearCollect formula as below:

ClearCollect(
             LoanChartNew, 
             AddColumns(             
                        ShowColumns('Loan Table',"Year","Title","Total_x0020_Outstanding").
                        "TotalOutstandingValue",
                         Text(Value(Total_x0020_Outstanding), "##,###")
             )
)

then set the Items property of the Pie Chart control to following:

LoanChartNew

set the Series property of your Pie Chart control to following:

 

TotalOutstandingValue

 

Please take a try with above solution, check if the issue is solved.

 

Best regards,

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

12 REPLIES 12
Super User
Super User

Re: How to roundup decimals and add comma in a chart data lable

Have you tried using the Round function? 

 

RoundNumberDecimalPlaces ) 

 

In your case it will be Round(Number, 0)

 

Let me know if this doesn't work for you. 

 

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

 

Hardit Bhatia
https://www.thepoweraddict.com

OsmandFernando Post Prodigy
Post Prodigy

Re: How to roundup decimals and add comma in a chart data lable

@PowerAddict Thank you for your reply. To where I should apply it ?

Highlighted
Super User
Super User

Re: How to roundup decimals and add comma in a chart data lable

How are you populating your chart? OR where are you defining the data for your chart?

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit Bhatia
https://www.thepoweraddict.com
OsmandFernando Post Prodigy
Post Prodigy

Re: How to roundup decimals and add comma in a chart data lable

as I mentioned the data coming to the chart from the collection. Collection it self is having that long decimals

@PowerAddict 

Super User
Super User

Re: How to roundup decimals and add comma in a chart data lable

What is the Items property of the chart set to? 

 

Is it something like ChartCollection.Value?

 

If so, set it to Round(ChartCollection.Value,0)

 

Let me know if this helps.

 

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

 

Hardit Bhatia
https://www.thepoweraddict.com

OsmandFernando Post Prodigy
Post Prodigy

Re: How to roundup decimals and add comma in a chart data lable

This is what I have. I tried Round(LoanChartNew.Total_x0020_Outstanding,0) but did not work

 

@PowerAddict 

 

Capture.PNG

Super User
Super User

Re: How to roundup decimals and add comma in a chart data lable

So nothing changed? Or did you get an error? 

 

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit Bhatia
https://www.thepoweraddict.com

OsmandFernando Post Prodigy
Post Prodigy

Re: How to roundup decimals and add comma in a chart data lable

I did not get anything, Chart went blank

Community Support
Community Support

Re: How to roundup decimals and add comma in a chart data lable

Hi @OsmandFernando ,

Could you please share a bit more the column value you used within your Pie Chart to display the number value? Is it a Number type column or a Calculated type column?

 

Based on the issue that you mentioned, I think the AddColumns function and Text function could achieve your needs. I have made a test on my side, please consider take a try with the following workaround:

Set the Items property of the Pie Chart control to following:

 

AddColumns(
           LoanChartNew.Total_x0020_Outstanding,
           "LoanFormatValue",
           Text(Value(LoanValueColumn), "##,###") // LoanValueColumn represents the column you use to display the loan value, e.g. 900000.000.. within your Pie Chart
)

 

Then set the Series property of your Pie Chart control to following:

 

LoanFormatValue

 

then the formatted loan value would be displayed within your Pie Chart.

 

Please take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (7,663)