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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Bar Graph from Sharepo...
Power Apps
Answered

Bar Graph from Sharepoint for two columns and sum of total.

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a sharepoint list called 'Expense' with ~20 columns. Among them i am trying to create a bar graph using "Category" and "Total Amount".. 

i need to group "Category" like bills, travel... etc

Sum of group of category....

in a bar graph...

I tried multiple solutions here in community but failed... Can someone help please
Thanks

Categories:
  • JesperHuang Profile Picture
    56 on at

    Hi @Anonymous ,

     

    Is this what you want?

    example1.png

     

    Here is the code i put in Onselect event:

    ClearCollect( Expense, 
     { Category: "Learn", Price: 8615000}, 
     { Category: "Bills", Price: 3562000}, 
     { Category: "Travel", Price: 3165000}, 
     { Category: "Books", Price: 2874000}, 
     { Category: "Learn", Price: 2273000}, 
     { Category: "Bills", Price: 1760000}, 
     { Category: "Travel", Price: 1602000}, 
     { Category: "Bills", Price: 1494000}, 
     { Category: "Books", Price: 1344000}
    );
    ClearCollect(GroupExpense, GroupBy(Expense,"Category","Prices"));
    ClearCollect(SumByCate, AddColumns(GroupExpense, "Total Amount", Sum(Prices,Price)));

     

  • Verified answer
    yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hey @Anonymous 

     

    Can you try to use the below expression on the Items property of your graph?

    AddColumns(GroupBy(SPListName,"Category","Grouped"),"TotalCount", Sum(Grouped, TotalAmount))

    Then, you can use Category and TotalCount in the graph series and labels.

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    But i do not want to define the category in Powerapps since its going to be a dynamic values... Some categories will be added later in the stage. how to do without defining categories manually in powerapps? 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you so much... this perfectly worked 🙂
    I am so glad to learn how to make bar graph now.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard