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 / Two labels in filtered...
Power Apps
Answered

Two labels in filtered gallery

(0) ShareShare
ReportReport
Posted on by 96

I have a gallery with Items like:

 

Distinct(
 Source,
 Title
)

 

 

and Label1 like:

 

ThisItem.Result

 

 

I would like to add another Label2 with text from another column B (based on a ThisItem.Result from Label1). 

 

Title columns is not unique and ColumnB is not unique but there is always the same value for each row like below:

 

TitleColumn B
a111
a111
a111
b222
b222
b222
b222
c333
c333
c333
c333
c333
c333
c333
x888
x888
x888
x888


So what I want to show is:

TitleColumn B
a111
b222
c333
x888



How should I do this?

Categories:
  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @Mariollo 

     

    Distinct always returns only one. So we have to use Group by

    GroupBy(DataSource, "Title", "ColumnB")

     


    Thanks,
    Stalin - Learn To Illuminate

  • Verified answer
    PowerRanger Profile Picture
    3,458 Super User 2024 Season 1 on at

    @Mariollo 

    You have to use GroupBy

    GroupBy(SampleList,"Title","myGrpoupedColumns")

     

    For the second Label whcih should show the value of column B use this for the Text property

    First(ThisItem.myGrpoupedColumns).FirstName

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

  • Mariollo Profile Picture
    96 on at

    @PowerRanger @StalinPonnusamy 
    Thank you guys, it's working now.

    I believe that using GroupBy is much better than Distinct in Galleries, right?

     

  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Distinct results in only one column. It all depends on what we are looking for.

     

    Sometimes it works based on the requirement. In Some cases, the user wants to display all countries in the gallery with a checkbox. In that case, we need distinct on the gallery.

     

    In your case, you need GroupBy.


    Thanks,
    Stalin - Learn To Illuminate

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 352 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 323

#3
Mohsin Ali Profile Picture

Mohsin Ali 226

Last 30 days Overall leaderboard