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 / Display many to one re...
Power Apps
Answered

Display many to one relationship in Model Driven App grid view (filter the Many to one)

(0) ShareShare
ReportReport
Posted on by 10

Suppose I have a table of customers and a table of purchases. Each purchase belongs to one customer. I want to display a grid view of all customers along with their last purchase. How is that done in a Model Driven App? Can I bring in the last purchase with a formula column?  or should I use Power BI? Or should I use Dataflow to join these tables?! But Dataflow is limited to a 30-minute update.

 

Please use these table/column names in your answer:

customer: id, name
purchase: id, customer_id, item_id, date


----------------------------

 

Similar to the above question. How do I make a form of the customer table it should include only the last purchase in the subgrid component?

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

    What sort of volume of purchases are you expecting?

     

    If volumes are relatively low, you could use power automate to write the details of a purchase to the customer table each time a purchase is made.

     

    There is also the option of doing the same using JavaScript calling in the onSave event of the purchase

     

    Happy to help either option if you think one would be suitable? 

  • Verified answer
    narayan225 Profile Picture
    2,547 Super User 2025 Season 2 on at

    @PowerAppsCom1 

     

    If you are creating a view, you can create a view from the Purchase table to list the associated customer and sort it by created.

     

    If you need it from customer, you can create a lookup to the last purchase. You can use a flow to pupulate that column whenever the new order is created.

     

    This should allow you to create your view and add to your form.

     

    Cheers!

  • PowerAppsCom1 Profile Picture
    10 on at

    Thank you for your reply.

    I don't want to go with the Power Automate and JavaScript solution since they might trough errors and I will also have duplicate data. I wonder how come this is not a build feature in Power Apps. This is probably a broad-looked feature. The example above is just 1 of the many N:1 relationship grid views I'm looking for. How can you analyze your data without this view? 

    How will I go when I want to check customers who didn't purchase anything in the last year or customers with total sales greater than a certain amount?

    The same need can be with a School with a list of students and multiple tests and gradings 

    How can they analyze who completes the tests and so on?  

     

    The concept I look for is to have a grid of 1 row per customer/student etc. and pull into the view certain subtables so we can find things without opening each customer/student etc. record. 

    It is quite interesting that in Excel you can do all kinds of lookups and here you are so limited.

    Do you know if, with the Canvas app, we can do this kind of grid?
    Or maybe I should look into the Reports feature?

  • Verified answer
    SBax Profile Picture
    1,348 on at

    You could use a canvas app, combine filter and first functions to accomplish this.

     

    You could even use the creator kit "details list" component to display a list of customers, use add columns to create your last purchase alongside any other columns, and configure the list to navigate to the main form if required.

     

    I would say this is your best option if you want a list, and don't want to use flow or JS

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…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 445

#2
WarrenBelz Profile Picture

WarrenBelz 386 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 321 Super User 2025 Season 2

Last 30 days Overall leaderboard