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 / Resource Planning (Piv...
Power Apps
Unanswered

Resource Planning (Pivot/Unpivot Dates)

(0) ShareShare
ReportReport
Posted on by 29

Hello,

 

I have a fairly complex (for me) issue that I am trying to resolve.

 

I am trying to build an application to enter upcoming resource allocation.

 

This is to replace an Excel workbook where each row details a user and a project. The user is then able to enter the number of days they are intending to work for that week:

 

RDC_0-1674138793428.png

 

I have tried to create a similar option using Dataverse. The problem is that only one week can be entered at a time (as having dates as columns is not really viable), which is much more awkward and the users are not happy with it as they need to enter multiple records at once for themselves and other users:

 

RDC_1-1674139467499.png

 

The solution I have come up with is to create a vertical gallery to show the User and Project (using the GroupBy function for both of those columns to remove duplicates).

 

I have then nested a horizontal gallery into the vertical gallery in order to show all of the dates for that user and project:

 

RDC_0-1674930840717.png

 

I have used the "New Row" button to patch records with the current user's name, a blank project, and a record with "0" days for each week commencing currently displayed on the screen. I am then using "OnChange" to patch updates to any of the days.

 

The problems that I am experiencing are:

 

1. There needs to be a record even for a week when there are no days so that it is possible to compare availability for each week. Patching a load of empty records seems like an extremely inefficient method. I thought I might be able to load them all to a collection and only patch them to dataverse if they contain a value. This still seems overly complicated.

 

2. Using GroupBy in the vertical gallery makes it very difficult to work with the data and any of the other fields. Is there a better approach to removing duplicates based on two fields?

 

Any suggestions on how to resolve these issues or perhaps even a completely different approach would be much appreciated.

 

Thanks!

 

Categories:
  • DavidZoon Profile Picture
    738 Most Valuable Professional on at

    Hello,
    I had to build a solution for a similar case, here is how I proceeded:

     

    I first created a gallery on the left part of the screen which serves as a legend for the absices, In this gallery I put a collection of my GroupBy, all in a ShowColumns() to not have only the columns that interest me.

     

    I then created a horizontal gallery with the only data source, the date range that interests me (with sequence() to generate a table of dates)

     

    Finally, in this gallery with the dates, I added a vertical gallery with the data source: AddColumns('MyCollectionGroupedBy',"Date",ThisItem.Value)

     

    Which in the end allowed me to have a grid (nested galleries) with in each cell a value Name, project, date, which is enough to find the corresponding record with a lookup for the value to display by default in a textimput or to patch a modification

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily.

  • RDC Profile Picture
    29 on at

    Hi David,

     

    Thanks for the response. I really appreciate it.

     

    I am struggling a little and would be very grateful for any further details.

     

    The gallery on the left, is that just a separate vertical gallery (with no nested galleries)?

     

    If you had any examples of the code, it would be great.

     

    Thanks again for your help!

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
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard