cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
BQC
Level: Powered On

Sorting gallery on full date

Hi guys!

I have an issue i haven't could find a solution to, which are when sorting gallery, is it possible to sort by full date (dd:mm:yy) instead of sorting on only (dd)?

Now it only sort on descending or ascending based upon days and not the full date, 

example on this issue in order of how the gallery is being sorted:

30-01-2018

29-01-2018

8-02-2018

7-02-2018

 

Here it is sorting on highest date only on days not countering months and years with it.

It should be 

8-02-2018

7-02-2018

30-01-2018

29-01-2018

 

I hope i have explained my issue sufficient or else, please ask for more explanation! 

 

1 ACCEPTED SOLUTION

Accepted Solutions
BQC
Level: Powered On

Re: Sorting gallery on full date

For those with similiar issues. I have finally found the solution.

I found out that excel online from onedrive and Powerapps aren't that good friends when it coming to formatting.

So i had to change the default format in excel to their date format through formatting.

The code i needed to use for the gallery:

Sort(Kvalitetsdata;DateValue(Dato);Descending)

 

View solution in original post

10 REPLIES 10
Vasii
Level 8

Re: Sorting gallery on full date

Hello @BQC

 

could you pls share a little bit more of your sorting code? 🙂

The sort in a gallery with the full date works fine for me with the code 

Sort(sorttest,date,Descending)

sorting.PNG

 

Best regards

Vasii

BQC
Level: Powered On

Re: Sorting gallery on full date

SortByColumns(Search(Kvalitetsdata; TextInput6.Text; "AntalAfvist";"AntalBestilt";"Leverandør";"Dato";"Medarbejder"; 
"AntalGodkendt"); "Dato"; If(SortDescending1; Descending; Ascending))

The above is the code i have right now set as Items.

My datasource is google sheets.

The gallery is combined with a search field, which filters based on search words

BQC
Level: Powered On

Re: Sorting gallery on full date

@Vasii Any ideahow to resolve this issue?

BQC
Level: Powered On

Re: Sorting gallery on full date

If i change my code from sortbycolumns to sort, it does the job of sorting as wished. but it is sorting in the wrong order. 

 

30-01

31-01

01-02

02-02

I need it to be reversed so it shows the lastest first. 

with the change from sortbycolumns to

Sort(Search(Kvalitetsdata; TextInput6.Text; "AntalAfvist";"AntalBestilt";"Leverandør";"Dato";"Medarbejder"; 
"AntalGodkendt"); "Dato";If(SortDescending1; Descending; Ascending))

the function If(SortDescending1; ) has stopped working with the binded icon. I can't use this function to change between Descending - Ascending. What gives? 

Vasii
Level 8

Re: Sorting gallery on full date

Hello @BQC,

 

i am sorry, unfortunately i was very ill the last time. 😞

 

Could you pls show me a screenshot of your scenario and what do you mean with the function If(SortDescending1; ) has stopped working, what did you do with this function in your scenario?

 

Best regards

Vasii

BQC
Level: Powered On

Re: Sorting gallery on full date

@Vasii 
image.pngAs displayed on the above image, i have a icon with sorts the gallery by descending and acending but if i change my gallery code 

SortByColumns(Search(Kvalitetsdata; TextInput6.Text; "AntalAfvist";"AntalBestilt";"Leverandør";"Dato";"Medarbejder"; 
"AntalGodkendt"); "Dato"; If(!SortDescending1; Descending; Ascending))

To the one you suggested, i cannot change the order with the binded icon.

 

 

Vasii
Level 8

Re: Sorting gallery on full date

Hi @BQC

 

I've tried it with the Sort function and it's working fine for me.

Take a look at this Link for more information about the SortByColumn function, i think it's not working for you, cause you have to make a SortOrder for each column you'll sort.

 

I never used SortByColumn before, maybe you can get some help from @v-xida-msft or @v-yuxima-msft x)

 

Best regards

Vasii

TopShelf-MSFT
Level 10

Re: Sorting gallery on full date

Hi @BQC thanks for posting in the community and I'm sorry you're running into this issue. Can you advise if you're still experiencing this issue and if the above reply was helpful?

 

Thank you,

 

@TopShelf-MSFT 

BQC
Level: Powered On

Re: Sorting gallery on full date

hello @TopShelf-MSFT 

I still haven't figured out how to resolve the issue and don't know how i should write the code. I am not so strong in the coding part

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Kudoed Authors (Last 30 Days)
Users online (4,882)