cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Km00
Helper III
Helper III

Filter, IsBlank and sort

Need help combing what i have with the Sort descending, ascending.

 

Filter(ThisItem.grAreaDetail,!IsBlank('Area_Function (Area_Function1)'))

 

This is filtering a gallery.

 

When i added it at the end, i got blank results so that wasn't what i wanted to achieve.  I just want to put the results in order.

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @Km00 ,

 

Please try this formula:

Sort(ForAll(Distinct(ThisItem.grAreaDetail.DepartmentID),LookUp(ThisItem.grAreaDetail,DepartmentID=Result)),DepartmentID,Ascending)

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

4 REPLIES 4
mdevaney
Super User
Super User

@Km00 
Try this code in the Items property of the gallery.  Replace table and column names with your own.

Sort(
    Filter(
        YourTableName,
        YourColumnName=Blank()'
    ),
    SortColumnName,
    Ascending
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Km00
Helper III
Helper III

i tried that and it makes it all blank now.

 

this is what i did:  Sort(
Filter(
ThisItem.grAreaDetail,'Area_Function (Area_Function1)'=Blank()),
DepartmentID,
Ascending
)

 

and screenshot shows the blank gallery

 

Km00_0-1612468023666.png

 

Km00
Helper III
Helper III

I did this and was able to get it to sort but now, it shows all the duplicates. Only want one instance of each number.

 

Sort(
Filter(
ThisItem.grAreaDetail,!IsBlank('Area_Function (Area_Function1)')),
DepartmentID,
Ascending
)

 

Km00_0-1612468943076.png

 

v-xiaochen-msft
Community Support
Community Support

Hi @Km00 ,

 

Please try this formula:

Sort(ForAll(Distinct(ThisItem.grAreaDetail.DepartmentID),LookUp(ThisItem.grAreaDetail,DepartmentID=Result)),DepartmentID,Ascending)

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (1,548)