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 / Adding column to exist...
Power Apps
Unanswered

Adding column to existing collection

(0) ShareShare
ReportReport
Posted on by 6

Hello,

 

I have an existing collection of distinct items. Then I have other collections that gets filtered data from a SharePoint List. I need to add columns to the first collection with sums from those other collections. Suggestions?

 

Thanks!

//First collection has one unique column:
(ClearCollect(colPANELS,RenameColumns(Distinct(colINV,Panel),"Result","Panel_")));

//Trying to add columns:
AddColumns(colPANELS,
"LoadPhA",Sum(Filter(colPLA,Panel=Panel_),A),
"LoadPhB",Sum(Filter(colPLB,Panel=Panel_),A));

 

Categories:
I have the same question (0)
  • v-qiaqi@microsoft.com Profile Picture
    on at

    Hi @menglish,

    Do you want to sum total by the same panels in the new column?

    Could you please tell me what you colPLA and colPLB looks like?

     

    Show me the data set of the colPLA and colPLB.

    colPLA:

    Panel A
    PLA 1
    PLA 2
    PLB 3

    colPLB:

    Panel A
    PLB 4
    PLB 5
    PLA 6

    colPANELS:

    Panel_ LoadPhA LoadPhB
    PLA 3 6
    PLB 3 9

     

    Is the above data same as you configure in your scenario? If not, please correct me.

  • menglish Profile Picture
    6 on at

    Hello,

     

    I've tried to work on this with no luck so far.  I am trying to first add columns by doing a lookup to another source. Then adding other columns after doing calculations. There are 4 records in colPANELS and only some values are being added to some of the records (see attached picture). I don't understand why.

    (ClearCollect(colPANELS,
    AddColumns(Distinct(colINV,Panel),
     "LoadPhA","",
     "LoadPhB","",
     "LoadPhC","",
     "ReadingPhA",LookUp('EQ Panels',Title=Result).IA,
     "ReadingPhB",LookUp('EQ Panels',Title=Result).IB,
     "ReadingPhC",LookUp('EQ Panels',Title=Result).IC
     )));
    
    Concurrent(
    ClearCollect(colPLA,Filter(colINVP,(Phase="A"||Phase="A/B"||Phase="A/B/C"||Phase="B/C/A"||Phase="C/A"||Phase="C/A/B"))),
    ClearCollect(colPLB,Filter(colINVP,(Phase="A/B"||Phase="A/B/C"||Phase="B"||Phase="B/C"||Phase="B/C/A"||Phase="C/A/B"))),
    ClearCollect(colPLC,Filter(colINVP,(Phase="A/B/C"||Phase="B/C"||Phase="B/C/A"||Phase="C"||Phase="C/A"||Phase="C/A/B"))));
    
    UpdateIf(colPANELS,true,{ 
     LoadPhA:Sum(Filter(colPLA,Panel=Result),A), 
     LoadPhB:Sum(Filter(colPLB,Panel=Result),A), 
     LoadPhC:Sum(Filter(colPLC,Panel=Result),A)
     
     });

     

     

    colPANELS.JPG

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…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 793 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard