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 / Bar Graph from Sharepo...
Power Apps
Unanswered

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

(1) ShareShare
ReportReport
Posted on by

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:
I have the same question (0)
  • 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
    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
    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

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