cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Sales Leader board in Gallery Sum If Help

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Sales Leader board in Gallery Sum If Help

@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."

View solution in original post

4 REPLIES 4
Highlighted
Super User
Super User

Re: Sales Leader board in Gallery Sum If Help

@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."

Highlighted
Anonymous
Not applicable

Re: Sales Leader board in Gallery Sum If Help

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

Highlighted
Super User
Super User

Re: Sales Leader board in Gallery Sum If Help

@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."

View solution in original post

Highlighted
Anonymous
Not applicable

Re: Sales Leader board in Gallery Sum If Help

YOU'RE AWESOMEWINNING.PNG

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (9,930)