Hi @becca51180 ,
It is always good to use Format Text on your code, so it appears as below (saves time for responders not needing to format), however two things - if the first bit is not working- firstly, a bit of a plunge - try this on the Items of your Gallery (free-typed, so please convey any errors)
With(
{
wList:
Sort(
AddColumns(
GroupBy(
AddColumns(
NominationsList,
"NomineeName",
Nominee.DisplayName,
"NomineeFullname",
Last(
Split(
Nominee.DisplayName,
","
)
).Result & " " &
First(
Split(
Nominee.DisplayName,
","
)
).Result
),
"NomineeName",
"NomineeFullname",
"GroupByUsersDisplayName"
),
"Total Noms",
CountRows(GroupByUsersDisplayName),
"TotalBadgeTypes",
CountRows(
Distinct(
GroupByUsersDisplayName,
BadgeType
).Result
)
),
'Total Noms',
Descending
)
},
ForAll(
Sequence(CountRows(wList)),
Patch(
Last(
FirstN(
wList,
Value
)
),
{RowNumber: Value}
)
)
)
Winding back a bit - your two collections
ClearCollect(
LeaderList,
AddColumns(
GroupBy(
AddColumns(
NominationsList,
"NomineeName",
Nominee.DisplayName,
"NomineeFullname",
Last(
Split(
Nominee.DisplayName,
","
)
).Result & " " &
First(
Split(
Nominee.DisplayName,
","
)
).Result
),
"NomineeName",
"NomineeFullname",
"GroupByUsersDisplayName"
),
"Total Noms",
CountRows(GroupByUsersDisplayName),
"TotalBadgeTypes",
CountRows(
Distinct(
GroupByUsersDisplayName,
BadgeType
).Result
)
)
);
Clear(LeaderList_Numbered);
With(
{
wList:
Sort(
Devices,
'Total Noms',
Descending
)
},
ForAll(
Sequence(CountRows(wList)),
Collect(
LeaderList_Numbered,
Patch(
Last(
FirstN(
wList,
Value
)
),
{RowNumber: Value}
)
)
)
)
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.