Hi @Justinn111_, you are very close - the issue is the sort key and, if you stay with SortByColumns, the way the column name has to be written.
Sorting by two keys
Microsoft Learn's documented pattern for sorting by one column and then another is to nest Sort inside Sort, for example Sort( Sort( Contacts, LastName ), FirstName ) to sort first by LastName and then by FirstName. Applied to your gallery, with Asset Category as the primary key and your numeric suffix as the secondary:
Sort(
Sort(
AddColumns(
Filter( [@'FSC Assets Management'], StartsWith('Asset No', "SFSC-FZ") ),
Suffix, Value( Last( Split( ThisRecord.'Asset No', "-" ) ).Value )
),
'Asset Category'
),
Suffix,
If( SortDescending1, SortOrder.Descending, SortOrder.Ascending )
)
Sort takes a formula rather than a string, so you can reference the column directly and the ThisRecord operator is available inside it.
If you keep SortByColumns - watch the space in the column name
This is the detail that catches most people out. Learn is explicit: for SharePoint and Excel data sources, a column name containing a space must have each space specified as _x0020_. So "Asset Category" has to be written as:
SortByColumns( YourTable, "Asset_x0020_Category" )
Passing a plain "Asset Category" string is the usual reason SortByColumns appears to do nothing at all.
Driving it from the drop-down
Populate the drop-down with Distinct( 'FSC Assets Management', 'Asset Category' ) and use the selection to filter the gallery, keeping the sort above to control ordering within each category.
One caution on delegation
AddColumns combined with Value(Split(...)) is not delegable, so the sort only ever evaluates the rows that have already been pulled into the app. If the list is larger than your data row limit you will get inconsistent ordering. Check the delegation warnings in the formula bar and consider storing the numeric suffix as its own SharePoint column so the sort can be delegated.
References
Found this helpful? Please mark ✅ "Does this answer your question?" so others searching for the same issue can find it quickly. A 👍 on "Was this reply helpful?" or a ♥ Like is also much appreciated!
Raghav Mishra - LinkedIn| PowerAI Labs