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 / Building Sales reports
Power Apps
Answered

Building Sales reports

(0) ShareShare
ReportReport
Posted on by 287

I have a nice starter app going that stores each PO in my company.  I keep sales price and vendor price and calculate profit with a simple sales price - vendor price.

I would like to now generate some simple sales screens showing:

1. Sales by Vendor (top 10)

2.  Sales by Client (top 10)

3.  Profit by Customer (top 10)

 

Also, I realize powerBI might be the easiest, however I was hoping not to be licensed to death and able to do it with the native functions in Power Apps I'm already paying for?

Anyone with the best approach?

Categories:
I have the same question (0)
  • KvB1 Profile Picture
    1,596 on at

    I would use a gallery with FirstN(Sort( to show the first 10 records of your list sorted by whichever metric you want to show. You could have a gallery for each metric, or have them all in one gallery and change the view based on a dropdown or something

  • astrontelstar Profile Picture
    287 on at

    Still a little stuck; sorry.  So How can I get the table where it tallys each customer by adding up all their orders?  I don't want to have to write a function for each client.  Does that make sense?

     

  • Verified answer
    rubin_boer Profile Picture
    4,843 Super User 2024 Season 1 on at

    hi @astrontelstar you have a few steps to do.

     

    I am going to make a few assumptions:

    • Purchase Order is unique (but it repeats for vendor, client, and profit)
    • you have a column for PO
    • you have a column for Vendor & Vendor Price
    • you have a column for Client & Client Price
    • you have a column for Customer Profit (client = customer)

     

    PO | Vendor | Vendor Price | Client | Client Price | Customer Profit

    The data will look something like this in a gallery (yours will differ, but the principle is the same)

    I collected in a collection colProfit2

    rubin_boer_1-1627330498166.png

     

    Now let's create three collection for you to keep things simple. 

    col1: colClientTotals

     

    ClearCollect(colClientTotals,AddColumns(GroupBy(colProfit2, "Client", "Clients"),"Clients's Total Price", Sum(Clients,'Client Price')))

     

    col2: colVendorTotals

     

    ClearCollect(colVendorTotals,AddColumns(GroupBy(colProfit2, "Vendor", "Vendors"),"Vendor's Total Price", Sum(Vendors,'Vendor Price')))

     

    col3: colCustomerProfits

    ClearCollect(colCustomerProfits,AddColumns(GroupBy(colProfit2, "Client", "Profits"),"Clients's Total Profit", Sum(Profits,'Customer Profit')))

     

    add 3 galleries with 2 labels each.

    label1: descriptor

    label2: total

    Gallery to show clients, i created 4 distinct clients

    Gallery Item = colClientTotals

    rubin_boer_2-1627330861833.png

     

    Gallery Item = colVendorTotals

    rubin_boer_3-1627330944150.png

    Gallery Item = colCustomerProfits

    rubin_boer_4-1627330987034.png

    To rank them, let ssee the top 3 for all (the collection is sorted in descending order so the first 3 entries are what we lookng for.

    Top 3 Client Prices 

     FirstN(Sort(colClientTotals,'Clients''s Total Price',Descending),3)

    rubin_boer_5-1627331042449.png

    Top 3 Vendor Prices

     FirstN(Sort(colVendorTotals,'Vendors''s Total Price',Descending),3)

    rubin_boer_7-1627331178482.png

    Top 3 customer profits

     FirstN(Sort(colCustomerProfits,"Clients's Total Profit",Descending),3)

    rubin_boer_8-1627331204877.png

     

    Hope this helps

     

     

     

     

  • astrontelstar Profile Picture
    287 on at

    Rubin,

    I think I'm stuck with trying to figure out collections still to generate colProfit2.

    When I do:

    ClearCollect(newCollection,Table({Client:'Mprinted Business Operations'.Customer}))

    Trying to build the first colProfit2 you mention, all I get in the collection is 1 record.

     

    Any advice?

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
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard