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

Sort Data Table

 

Hi,

 

Can someone tell me whats wrong with the following formula please, trying to sort a column in my data table in date order.

 

SortByColumns('Secondary Media','Date and Time_Column1', If(Sortsecmed, Ascending,Descending)

 

Screenshot attached if needed.

 

Thank you

 

Gaz

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Gazbeer ,

So I have this right (and pardon my parsing so I can read the formula better)

If(
     And(

          IsBlank(DataCardValue10),

         ( IsBlank(DataCardValue5)

     ) ),
     DisplayMode.Disabled,
     DisplayMode.Edit

)

The two red brackets are not required, but you need Or, not And (if either are blank, make it disabled) - so:-

If(
     IsBlank(DataCardValue10) || IsBlank(DataCardValue5),
     DisplayMode.Disabled,
     DisplayMode.Edit

)

View solution in original post

8 REPLIES 8
WarrenBelz
Super User III
Super User III

Hi @Gazbeer ,

 

The first thing you are missing is a closing bracket at the end to close SortByColumns

I have not looked at the rest of it too hard, but it looks OK providing the controls references are correct.

Hi Again 😂,

 

SortByColumns('Secondary Media','Date and Time_Column1'), If(Sortsecmed, Ascending,Descending)

 

I get a long red line under the ('Secondary Media','Date and Time_Column1') section.

 

Thanks

Hi @Gazbeer ,

 

I should have looked harder - SortByColumns requires quotes "" around the column name being sorted.

 

Any reason you are not using Sort ? Your formula as present should work I think.

Only because i don't know any other way of bring the latest entered piece of information to the top of the table. I'm sorry i'' quite new to this and am learning as i'm going. Is there a better way of doing it? 

Hi @Gazbeer ,

You actually have three issues and I have only seen two of them until now.

Dates are not delegable filters (as I curse at times).

One workaround is to have a numeric value (DateValue) generated in the SharePoint list. I have a workaround tracking IDs and when they were created, but this only works on creation dates.

Ah ok, bit of a nuisance then, whilst I've got you, I'm making a save button that is disabled until data is entered in multiple boxes. 

 

If(And(IsBlank(DataCardValue10), (IsBlank(DataCardValue5))), DisplayMode.Disabled,DisplayMode.Edit) 

 

is my formula, which works, but puts the button back in 'edit mode' if data is entered into any box individually, but i need info in all boxes before it turns it to edit.

 

Thank you

Hi @Gazbeer ,

So I have this right (and pardon my parsing so I can read the formula better)

If(
     And(

          IsBlank(DataCardValue10),

         ( IsBlank(DataCardValue5)

     ) ),
     DisplayMode.Disabled,
     DisplayMode.Edit

)

The two red brackets are not required, but you need Or, not And (if either are blank, make it disabled) - so:-

If(
     IsBlank(DataCardValue10) || IsBlank(DataCardValue5),
     DisplayMode.Disabled,
     DisplayMode.Edit

)

View solution in original post

Amazing thank you!

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

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

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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.

Top Solution Authors
Top Kudoed Authors
Users online (3,974)