I have a SharePoint List with the Title field populated with the following data format:
24-1000.01
24-1000.02
24-1001.01
24-1002.01
24-1002.02
24-1002.03
The first thing I am trying to do with this data is use the GroupBy and Left functions to look at the 7 leftmost characters, then display a list of unique values in a gallery. So, the results would be:
24-1000
24-1001
24-1002
@metalproswi - that is a completely different format than the one you asked for in your first post. You're going to need to create a Nested Gallery for that.
Sorry about that. I was trying several things. The formula is no longer erroring; however the data is not displaying correctly.
My data set is like this:
24-1000.01
24-1000.02
24-1001.01
24-1002.01
24-1002.02
24-1002.03
And I would like to display it like this:
24-1000
24-1000.01
24-1000.02
24-1001
24-1001.01
24-1002
24-1002.01
24-1002.02
24-1002.03
This is the what the current output is displaying like:
@metalproswi - please could you use the code I provided. At present you're trying to do something else (using the Distinct function is not part of my suggestion).
I am using an empty column in my SharePoint List, but I can't get past the generic 'invalid arguments' message. I will read up more on the AddColumns function.
"metalproswi_custom_column" is a random name I gave to the newly added column. You can use any name you want.
DropColumns(
GroupBy(
AddColumns(
'2024 MP Lot Records',
"title_custom",
Left(
Title,
7
)
),
"title_custom",
"GroupedItems"
),
"GroupedItems"
)
Further reading on the AddColumns function:
https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-table-shaping
I can't get past a logic error after entering the data source.
I tried the 'Distinct' and 'DropColumns' suggestions, however non worked in my gallery. I will try recreating my gallery from a basic app to rule out any other variables.
@metalproswi - one example:
DropColumns(
GroupBy(
AddColumns(
'Your Table,
"metalproswi_custom_column",
Left(
Title,
7
)
),
"metalproswi_custom_column",
"GroupedItems"
),
"GroupedItems"
)
Please note the GroupBy function is not delegable.
Try this on your gallery.
Distinct(DataSource, Left(Title, 7))
WarrenBelz
146,743
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,089
Most Valuable Professional