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 / Multiples rows to one ...
Power Apps
Answered

Multiples rows to one row with filter

(0) ShareShare
ReportReport
Posted on by

HI Experts!

 

I have this SPO list :

 

Kepcla_1-1699885662324.png

 

 

and I want a collection like that (every column with "YES", and a "NO" if there is no "YES")

 

Kepcla_2-1699885706938.png

 I tried with GroupBy and Split, but it only captures the first line.

Any ideas ? 

Tks in advance!!!

 

 

Categories:
I have the same question (0)
  • Verified answer
    Anchov Profile Picture
    1,986 on at

    Here is one way to do it, but maybe there is a more elegant solution.

     

    //Create collection with orignal values from SPO List. I didnt have a SPO list, so I just created manually.
    ClearCollect(
     colRawData,
     {
     City: "New York",
     Vanilla: "YES",
     Chocolate: "NO",
     Berries: "NO",
     Mint: "NO",
     Lemon: "NO"
     },
     {
     City: "New York",
     Vanilla: "NO",
     Chocolate: "YES",
     Berries: "NO",
     Mint: "NO",
     Lemon: "NO"
     },
     {
     City: "New York",
     Vanilla: "NO",
     Chocolate: "NO",
     Berries: "YES",
     Mint: "NO",
     Lemon: "NO"
     }
    );
    //Cleansed list
    Clear(colCleanData);
    ForAll(
     Distinct(
     colRawData,
     City
     ) As city,
     Collect(
     colCleanData,
     {
     City: city.Value,
     Vanilla: If(
     CountRows(
     Filter(
     colRawData,
     Vanilla = "YES" && City = city.Value
     )
     ) > 0,
     "YES",
     "NO"
     ),
     Chocolate: If(
     CountRows(
     Filter(
     colRawData,
     Chocolate = "YES" && City = city.Value
     )
     ) > 0,
     "YES",
     "NO"
     ),
     Berries: If(
     CountRows(
     Filter(
     colRawData,
     Berries = "YES" && City = city.Value
     )
     ) > 0,
     "YES",
     "NO"
     ),
     Mint: If(
     CountRows(
     Filter(
     colRawData,
     Mint = "YES" && City = city.Value
     )
     ) > 0,
     "YES",
     "NO"
     ),
     Lemon: If(
     CountRows(
     Filter(
     colRawData,
     Lemon = "YES" && City = city.Value
     )
     ) > 0,
     "YES",
     "NO"
     )
     }
     )
    )

     

     

     


    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

    Cheers!
    Rick Hurt

  • Kepcla Profile Picture
    on at

    Not bad...I used the function FIRST with FILTER for every column and then collect, your solution works and mine too. 

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 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard