Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Query
Suggested answer

Problems combining two collections

(0) ShareShare
ReportReport
Posted on by
I have the following collections
 
ClearCollect(
  colActualEventCount,
    ShowColumns(
       Filter(
         Jobs, StartDate >= dp_SearchStartDate && StartDate <= dp_SearchEndDate.SelectedDate
     ),
     Job_Id,
     Band_Id_fk,
     EventName,
     JobClassification_Id_fk,
     StartDate, 
     Status_Id_fk
   )
);
 
ClearCollect(
  colCeremonialBandUnitEvents,
    ShowColumns(
      Filter(UnitsToJobs, Value(dd_BandSelection.Selected.Band_Id) = Value(Band_Id_fk)
      && Unit_Id_fk = 149)
    ),
    Job_Id_fk,
    Band_Id_fk,
    Unit_Id_fk,
    UnitCode
);
 
The colActualEventCount has a one to many relationship with the colCeremonialBandUnitEvents collection.
 
How do I create the query that would perform an join of the colActualEventCount and the colCeremonialBandUnitEvents based on Job_Id = Job_Id_fk and return the columns Job_Id, Unit_Id, EventName, StartDate, JobClassification_Id_fk and Unit_Id_fk and UnitCode? 
 
Also, where can you recommend go place to learn about how to develop queries for Power Apps?
Categories:
  • WarrenBelz Profile Picture
    148,294 Most Valuable Professional on at
    Problems combining two collections
    Offering another structure that may be also useful.
    ClearCollect(
       colCombined
       RenameColumns(
          AddColumns(
             colCeremonialBandUnitEvents,
             EventName,
             LookUp(
                colActualEventCount As _Data,
                _Data.Job_Id_fk = Job_Id
             ).EventName,
             JobClassification_Id_fk,
             LookUp(
                colActualEventCount As _Data,
                _Data.Job_Id_fk = Job_Id
             ).JobClassification_Id_fk,
             StartDate,
             LookUp(
                colActualEventCount As _Data,
                _Data.Job_Id_fk = Job_Id
             ).StartDate,
             Status_Id_fk,
             UnitCode,
             LookUp(
                colActualEventCount As _Data,
                _Data.Job_Id_fk = Job_Id
             ).UnitCode
          ),
          Job_Id_fk,
          Job_ID,
          Unit_Id_fk,
          Unit_ID
       )
    )
    ​​​​​​
  • Suggested answer
    StretchFredrik Profile Picture
    3,031 Super User 2025 Season 1 on at
    Problems combining two collections
    Hello,
     
    Not sure if this is what you are looking for, but give it a shot and get back to me if there is anything you would like to do differently or if delegation warning is a problem with your datesources. 
     
    ClearCollect(
        colJoinedEvents,
        ForAll(
            colActualEventCount As currentActualEvent,
            ForAll(
                Filter(colCeremonialBandUnitEvents, Job_Id_fk = currentActualEvent.Job_Id) As unit,
                {
                    Job_Id: currentActualEvent.Job_Id,
                    EventName: currentActualEvent.EventName,
                    StartDate: currentActualEvent.StartDate,
                    JobClassification_Id_fk: currentActualEvent.JobClassification_Id_fk,
                    Unit_Id: unit.Unit_Id_fk,
                    UnitCode: unit.UnitCode
                }
            )
        )
    );
    
    If my response solved your issue, please mark it as ✅ Accepted Answer and give it a like.

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 770 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 494

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 399

Featured topics