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 / Sales Leader board in ...
Power Apps
Unanswered

Sales Leader board in Gallery Sum If Help

(0) ShareShare
ReportReport
Posted on by

I can not seem to find a solution and could really use some help: 

 

I have a powerapp connected to a sharepoint list that record new sales orders- I have a calculated column in sharepoint that gives me the units sold per each sale. I also have the sale qtys flowing to microsoft excel (no equations in the excel table).

I was able to get a gallery with distinct names, and countrows (count of sales) but need a way to sum the units sold for each name. This is currently pulling from the excel table since I could not work the distinct formula with the sharepoint list. All the equations I have tried give me an invalid argument like this one.

I tried to do the calculation in excel then just pull into powerapps for display, but apparently you can not use excel tables with formulas in powerapps. Open to changes, or doing this in a data table, but would also like to make a collumn chart with the seller and units sold eventually. 

 

THANK YOU 🙂 Sales leaderboard help.PNGexcel data.PNGSP data.PNG

 

Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,989 Moderator on at

    @Anonymous 

    I suggest using this code in the Items property of a gallery.  It will generate a list of salespeople ranked by units sold from greatest to least.  It is better to put in a Gallery vs. hardcoding because we don't want to do maintainance on the app everyone a salesperson joins/leaves the company.  This code can be reused for your Chart.

     

    Sort(
    AddColumns(
    Distinct(your_excel_datasource,'Sales Person'),
    "Units Total",
    Sum(your_excel_datasource,'Units Sold'))
    'Units Sold',
    Descending
    )

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Community Power Platform Member Profile Picture
    on at

    @mdevaney What did I do wrong here? leaderboard update.PNG

  • Verified answer
    mdevaney Profile Picture
    29,989 Moderator on at

    @Anonymous 

    You did nothing wrong.  My code had an error.  Here's the correction.

     

    Sort(
     AddColumns(
     GroupBy(InventorySold,"Sales Person","Results"),
     "Units Total",
     Sum(Results,'Units Sold')
     ),
     'Units Total',
     Descending
     )
    );

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Community Power Platform Member Profile Picture
    on at

    YOU'RE AWESOMEWINNING.PNG

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard