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 / Double filter on share...
Power Apps
Suggested Answer

Double filter on sharepoint list column

(0) ShareShare
ReportReport
Posted on by 413
Hi there, 
 
 
I have a sharepoint list called "Tracelot - Origini dosatori" and a column called "Dosatore". Other columns are "Origin" and "Active" (yes/no")
 
The values are compodes by a letter and a number: the possible letters are "S" and "O".
 
For example, I could have S1, S2, S3, S4, S5, O1, O2.
 
In a gallery I set the Items property with a Filter (italian configuration): 
 
Filter(
        'Tracelot - Origini dosatori';
        Attivo = true;
        Linea = VarLinea
)
 
 
 
But I need to order them FIRST by letters (first the S) and then by numbers, in order to see this order: S1, S2, S3, S4, S5, O1, O2.
Actually If I put anothe row in the list with "Dosatore" = S3 and I active that, I would see S1, S2, S4, S5, O1, O2, S3.
Hope I made this easy to understand..
 
Any idea?
Thanks
Categories:
  • Suggested answer
    Liquid error: Exception has been thrown by the target of an invocation. SaiRT14 Profile Picture
    1,992 Super User 2025 Season 1 on at
    pls try the following:
     
    Replace your Items property in the gallery with this formula:
    SortByColumns(
        AddColumns(
            Filter(
                'Tracelot - Origini dosatori';
                Attivo = true;
                Linea = VarLinea
            ),
            "LetterPart", Left(Dosatore, 1),  // Extract the letter part (S or O)
            "NumberPart", Value(Mid(Dosatore, 2, Len(Dosatore) - 1))  // Extract the numeric part
        ),
        "LetterPart", Ascending,  // First sort by letters (S before O)
        "NumberPart", Ascending   // Then sort by numbers
    )
     
    this should fix your issue, let me know if you still have issues.
  • Suggested answer
    timl Profile Picture
    37,422 Super User 2026 Season 2 on at
    Hi  Calcioscacchi 
     
    Something like this should work. For Dosatore values that begin with S, this prefixes it with "A-". For Dosatore values that begin with O, the prefix is "B-". 

    Therefore, the final result will order the S records before the O records.
     
    Sort(
       Filter(
               'Tracelot - Origini dosatori';
               Attivo = true;
               Linea = VarLinea
       );
       If(
            Left(Dosatore; 1) = "S"; "A-" & Dosatore;
            Left(Dosatore; 1) = "O"; "B-" & Dosatore;
            "C-" & Dosatore
       );
       SortOrder.Ascending
    )
     
  • Calcioscacchi Profile Picture
    413 on at
     
    Thanks, This did the job.
     
    Just a correction: the letter order is Descending:
     
    SortByColumns(
        AddColumns(
            Filter(
                'Tracelot - Origini dosatori';
                Attivo = true;
                Linea = Radio1_1.Selected.Value
            );
            'LetterPart'; Left(Dosatore; 1);  // Extract the letter part (S or O)
            'NumberPart'; Value(Mid(Dosatore; 2; Len(Dosatore) - 1))  // Extract the numeric part
        );
        "LetterPart"; SortOrder.Descending;  // First sort by letters (S before O)
        "NumberPart"; SortOrder.Ascending   // Then sort by numbers
    )
     

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 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard