Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

Group distinct values across lines and columns

Posted on by 71
Hi team, I am looking for some advice around grouping distinct values from a table.
 
As you can see below, you have three lines where there is a mixture of names defined as PM, Assistant.
 
Ultimately for each of the ID's, I would like to end up with an additional column showing each of the distinct names across those two columns.
 
Any thoughts, for most efficient way would be great.
 
ID Title Project     PM,       Assistant New Column
3 Variable 1     joe       steve Joe; Steve
3 Variable 2     steve       joe Joe; Steve
3 Variable 3     Joe   Joe; Steve
 
 
I use this to send emails within the app, but currently this would analyze all three lines and send Joe three emails.
But in the new column, this would group to just one and ultimately one email.
 
Thank you
  • Meekou Profile Picture
    Meekou 132 on at
    Group distinct values across lines and columns
    ​For your request, you will need to use GroupBy to merge the rows for same ID.
     
    Here is a sample demo
    ClearCollect(
        GroupedProject,
        AddColumns(
            GroupBy(
                Projects,
                ID,
                PMAssistantTable
            ),
            PMAssistant,
            Concat(
                Filter(
                    Distinct(
                        Split(
                            Concat(
                                ThisRecord.PMAssistantTable,
                                Lower(PM) & "," & Lower(Assistant) & ","
                            ),
                            ","
                        ),
                        Value
                    ),
                    Value <> ""
                ),
                Value,
                ","
            )
        )
    )
    Test Data
    Test Result
    Regards,
    Meekou
    Personal Support
    ​

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,246

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,884

Leaderboard