cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kosenurm
Super User
Super User

Another label in gallery when Items = Distinct

Hi,

 

I have a gallery whereby I want to show in labels the Distinct values in one Dataverse column which I am then sorting in Ascending order, so I am using...

 

Sort(Distinct('DVTable_Name', ColumnName1), ThisRecord.Result, Ascending)

 

For the label for the ColumnName1 values, I am using ThisRecord.Result.

 

What I need to do now is show another column value from the same Dataverse in this gallery as another label. This column is entitled "Access". 

 

Some of the items in ThisRecord.Result appear more than once with different "Access" column values, so I would like to concatenate all the times ThisRecord.Result's value has more than one Access column value, and display them in the label. 

 

Any help appreciated to amend my above Items code to do this. 

 

Thanks

K.

 

7 REPLIES 7
Drrickryp
Super User
Super User

@Kosenurm 

Distinct() produces a single column table with the column named "Result".  If you want to show results from other columns, I suggest that you use GroupBy('DVTable_Name', "ColumnName1","SomeOtherColumn","Restofdata").  Check out the documentation for the GroupBy() function here: https://docs.microsoft.com/en-us/power-platform/power-fx/reference/function-groupby 

Hi,

 

Thank you for the reply. 

 

I have used GroupBy instead of Distinct. There is more than one value in the "SomeOtherColumn", however, and I want to bring back each of these into the same label, where ColumnName1 is the groupedby value.

 

Any ideas?


Thanks again

K.

Drrickryp
Super User
Super User

@Kosenurm 

ThisItem.Restofdata.ColumnName2, etc.

Thanks. When I do GroupBy on the ColumnName1, and then add ThisItem.ColumnName2 to the other label, it only brings back one of the values, not all of them in one label?

 

Thanks

K.

Drrickryp
Super User
Super User

@Kosenurm 

It only brings back unique values like Distinct().

Is there a way I can get all values for this column, or would a nested gallery be the best? I'm considering that.

 

Cheers for your help

 

K.

Drrickryp
Super User
Super User

@Kosenu

Give it a shot.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,751)