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 / Problem with Pie-Chart
Power Apps
Unanswered

Problem with Pie-Chart

(0) ShareShare
ReportReport
Posted on by 4

I am new to Building Power Apps and have a Problem to get the right Data for a pie charts.

 

I have a Sharepoint list with simple Data:

Date (Type Date), Number(Type number), Product (Type selection)

x.y.z                      20                                Product1

x.y.z                      30                                Product2

x.y.z                      30                                Product1

 

Now i want to make a Pie chart wich shows me the Sum of Numbers of each Product. 

e.g. Product1 sum is 50.

I want do define a target value, e.g. 100

Then the pie chart should show me 50% reached (50 sales out of 100 reached)

 

Can anybody tell me what statement i have to use?

 

Regards

Steve

 

 

 

of 

Categories:
I have the same question (0)
  • Verified answer
    v-mingkz-msft Profile Picture
    Microsoft Employee on at

    Hi @SteveH2,

    Do you want to display the sum number of each project in pie chart and display the percentage of how many sales?

    I did some test according to your requirements.

     

    Following is my SP list.

    vmingkzmsft_1-1688452706352.png

    1. Set the Items property of Gallery as:

     

    AddColumns(GroupBy('List Test',"Name","NewGroup"),"ChartItems",Table({Value:100-Sum(NewGroup,number),label:"Gap"&"-"&100-Sum(NewGroup,number)&"%"},{Value:Sum(NewGroup,number),label:"Achieve"&"-"&Sum(NewGroup,number)&"%"}))

     

    2. Set the Items property of Pie chart as:

     

    ThisItem.ChartItems

     

    vmingkzmsft_2-1688455312483.png

     

    Best Regards,

    Kyrie 

     

     

  • SteveH2 Profile Picture
    4 on at

    Hi @v-mingkz-msft 

    Thanks for that solution, that is exactly what i am trying to do.

     

    As said, i am very new to power apps and don't have experience. This is my first project.

     

    I have tried to implement your solution, but I always get error messages.

    Do i need a gallery to get this running?

     

    I made a gallery, and put in your code with my List-Seetings as following:

    AddColumns(GroupBy('Magazin-Sales',"Artikel","NewGroup"),"ChartItems",Table({Value:100-Sum(NewGroup,Anzahl),label:"Gap"&"-"&100-Sum(NewGroup,Anzahl)&"%"},{Value:Sum(NewGroup,Anzahl),label:"Achieve"&"-"&Sum(NewGroup,Anzahl)&"%"}))

     

    This is my SP-List:

    SteveH2_0-1688986856974.png

     

    I get always an error here:

     

    SteveH2_1-1688988911392.png

    Function GroupBy has invalid Arguments. 

    "Artikel" -> Text, Number, boolean or date/time expected (something like this, translated from german)

     

    I can't find out the problem with this function?

     

    Best regards

    Stephan

  • SteveH2 Profile Picture
    4 on at

    I think i found the Problem now, first i had to use semicolon (;) instead of commas (,)

    2nd Problem i have not a text-column in my SP-List. I have a dropdown selection.

     

    With a Text-column, your exampel is working, with my dropdown selection not. How can i fix this?

     

    And another question: Now the Pie-chart is inserted in a gallery. Is it possible to show the charts without a gallery? I want to show an overview on the Mainpage.

  • v-mingkz-msft Profile Picture
    Microsoft Employee on at

    Hi @SteveH2,

    1. You can use AddColumns function to get the value of choice field and groupby.

    AddColumns(GroupBy(AddColumns('List Test',"ProductName",Artikel.Value),"ProductName","NewGroup"),"ChartItems",Table({Value:100-Sum(NewGroup,number),label:"Gap"&"-"&100-Sum(NewGroup,number)&"%"},{Value:Sum(NewGroup,number),label:"Achieve"&"-"&Sum(NewGroup,number)&"%"}))

     

    2. The chart embedded in gallery display the achieve percentage of each artikel, so it is dynamic and cannot be move out.

     

    Best Regards,

    Kyrie

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard