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

Sorting data table for date

Hi, 

 

I'm am trying to sort my data table in order of newest date at the top and older records at the bottom. As you can see from the picture it is currently oldest records at the top and newest at the bottom. 

 

I am relatively new to power apps and have tried creating the code using the formula reference page without success.

 

Is anyone able to help with this? 

 

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
brimstone
Advocate I
Advocate I

Hi @Channah 

 

This formula should help you:

 

SortByColumns(YourSource, Date, Descending)


Descending helps you bring your column in the right order that the newest dates are shown first.

Please let me know if this solves your problem or if I misunderstood it.

View solution in original post

4 REPLIES 4
brimstone
Advocate I
Advocate I

Hi @Channah 

 

This formula should help you:

 

SortByColumns(YourSource, Date, Descending)


Descending helps you bring your column in the right order that the newest dates are shown first.

Please let me know if this solves your problem or if I misunderstood it.

View solution in original post

Hi, 

 

Thanks for the response. 

 

How would I make the work with other code?  

Picture of my attempt attached. 

Hi @Channah 

 

You need to use the formula for your "Items" in the data table, where you put in your datasource.
So for your datatable you need to change the "Items"-field from 'MyDataSource' to the formula you put in behind your Text formula.

 

Hope this helps.

 

Brilliant Thanks for your help!!!

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,260)