web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Show percentage in the...
Power Apps
Unanswered

Show percentage in the pie chart and column chart

(1) ShareShare
ReportReport
Posted on by 205
Hi Everyone,
 
I have a SharePoint list with a column as below.
SharePoint list name: ListA
Column name: Qty
I have values ​​in the column Qty as 10; 20; 30; 40 ;50
How can create a power apps pie chart from the sharepoint list and the choice column?
I also want to use formula to create percentage in the pie chart. Can you please help this case?
I'm using below code but I don't know how to show percentage in the chart.
AddColumns( AddColumns( GroupBy( AddColumns( ShowColumns( 'ListA', Qty ), QtyValues, Qty.Value ), QtyNames, Grp_Qty ), NumberOfValues, CountRows(ThisRecord.Grp_Qty) ), LabelName, Concatenate( QtyNames, " (",NumberOfValues, ")" ) )
 
Many thanks.
ROSE
Categories:
I have the same question (0)
  • Verified answer
    Apurva Profile Picture
    91 on at
    Try this and please let me know if it works: 
     
    I created a collection to test your scenario
     
    Collection Code:
    ClearCollect(
        colQtyData,
        Table(
            { Qty: "10" },
            { Qty: "20" },
            { Qty: "30" },
            { Qty: "10" },
            { Qty: "20" },
            { Qty: "40" },
            { Qty: "50" },
            { Qty: "30" },
            { Qty: "10" },
            { Qty: "50" }
        )
    );
     
    Code for PieChart:
    ClearCollect(
        colQtyChart,
        AddColumns(
            AddColumns(
                GroupBy(
                    AddColumns(colQtyData, QtyValues, Value(Qty)),
                    QtyValues,
                    Grp_Qty
                ),
                NumberOfValues, CountRows(ThisRecord.Grp_Qty)
            ),
            Percentage, Round(ThisRecord.NumberOfValues / CountRows(colQtyData) * 100, 2),
            LabelName, Concatenate(QtyValues, " (", Text(ThisRecord.QtyValues), "%)")
        )
    );

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard