cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Filter with 1 sort

Filter('[dbo].[Employee_Per_Info]', Employee_ID = User_App_Employee_ID)

 

I'd like to sort by Emp_Per_ID, having the LAST Emp_Per_ID entry show first   - this is the record # field in my app.

So would it be something like;

SortColumns(
    [dbo].[Employee_Per_Info]', Employee_ID = User_App_Employee_ID);
    FilterLast(Emp_Per_ID); 

?

Having a little trouble 😞  any help is appreciated

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Filter with 1 sort

@Anonymous 

Assuming Emp_Per_ID is your column name you can use the SORT function to show in descending order.  SORTCOLUMNS would work too but the syntax is slightly different and we are only sorting 1 column here.

 

Sort(
    Filter(
        '[dbo].[Employee_Per_Info]',
        Employee_ID = User_App_Employee_ID
    ),
    Emp_Per_ID,
    Descending
)

 

---
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."

View solution in original post

7 REPLIES 7
Super User
Super User

Re: Filter with 1 sort

@Anonymous 

Assuming Emp_Per_ID is your column name you can use the SORT function to show in descending order.  SORTCOLUMNS would work too but the syntax is slightly different and we are only sorting 1 column here.

 

Sort(
    Filter(
        '[dbo].[Employee_Per_Info]',
        Employee_ID = User_App_Employee_ID
    ),
    Emp_Per_ID,
    Descending
)

 

---
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."

View solution in original post

Anonymous
Not applicable

Re: Filter with 1 sort

Believe it or not, that actually didn't work, all the labels in the gallery actually broke.

Filter('[dbo].[Employee_Per_Info]', Employee_ID = User_App_Employee_ID)   is 100% working. but doesn't sort 😞

Your formula looks like it SHOULD work but doesn't, am I missing a small syntax item?

Super User
Super User

Re: Filter with 1 sort

@Anonymous 

You did include SORT at the top of your formula, correct? I did not see it in the screenshot.

 

What message are you getting with the broken labels? Please send a screenshot.

Anonymous
Not applicable

Re: Filter with 1 sort

By Changing 

Sort(
    Filter(
        '[dbo].[Employee_Per_Info]',
        Employee_ID = User_App_Employee_ID
    ),
    Emp_Per_ID,
    Descending
);


to

Sort(
    Filter(
        '[dbo].[Employee_Per_Info]',
        Employee_ID = User_App_Employee_ID
    ),
    Emp_Per_ID,
    Descending
)


Removing the ; on the last line - now it sorts! And my last record is at the top just like I wanted.  You are amazing!

Thank you <3<3<3

Super User
Super User

Re: Filter with 1 sort

@Anonymous 

I have now changed this on my original post.  Please close this thread if your issue has been solved.

Anonymous
Not applicable

Another +1 to THE MAN MDEVANEY

I was able to use this exact post - AGAIN, to help another custom Filter.

Filter('[dbo].[V_Generic_Country_ProvinceState_City]',ProvinceState = Dropdown1_17.Selected.Result)

UPDATED TO

Sort(
Filter(
'[dbo].[V_Generic_Country_ProvinceState_City]',
ProvinceState = Dropdown1_17.Selected.Result
),
City,
Ascending
)


THANKS @mdevaney 

Super User
Super User

Re: Another +1 to THE MAN MDEVANEY

@Anonymous
It looks like we managed to create a very nice pattern for you to reuse over-and-over again. I am glad you are enjoying the solution and wish you the best of luck in building your apps!

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,532)