cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Filter Gallery by created time most recent only

I am trying to make a Gallery that only displays the most recent entries for a dataset.

The project is recording for the same "Zone" multiple times a day, and documenting Pass / Fail for that zone.

I have multiple zones to track and I want the gallery to only show me the most recent record for each unique zone.

I have the fill filters set (If done withing 6 hours green, if with in 12 red, else white) I want to see if they missed a zone which is why I want only the most recent entry per zone)

 

Basically

Sort by zone, pull only most recent created records.

I have most everything else figures out on this but am having issues with the making it only show the most recent entries.

1 ACCEPTED SOLUTION

Accepted Solutions

I got it now... I believe you need something like this

 

Sort(AddColumns(
GroupBy(Table1, "Zone", "TimeColumn"),
"MaxVal",Max(TimeColumn,TimeColumn)),
MaxVal,Ascending)

View solution in original post

5 REPLIES 5
Memorable Member
Memorable Member

I'm not sure if I undesrstand your question correctly. If you want to filter most recent datasource entry and you have column which record the timestamp when the record was created then use this

 

Filter(DatasourceName, TimeColumnName>DateAdd(Now(),-12, Hours))

 

This will filter your datasource with date created in last 12 hours.

Is this what you want?

That helps with another problem I was having, let me try and explain better

 

I have this data set

 

ZoneTime
A1/29/2018
B1/29/2018
C1/29/2018
D1/29/2018
A2/2/2018
B2/2/2018
C2/2/2018
A2/3/2018
B2/3/2018

 

From that I only want to see this

ZoneTime
D1/29/2018
C2/2/2018
A2/3/2018
B2/3/2018

 

Chronologically the last occurance of the station.

If need I can do with out the Gallery it's self, I just need this data to appear this way.

I got it now... I believe you need something like this

 

Sort(AddColumns(
GroupBy(Table1, "Zone", "TimeColumn"),
"MaxVal",Max(TimeColumn,TimeColumn)),
MaxVal,Ascending)

View solution in original post

Thanks that fixed part of the problem, trying to now merge that with another formula.

 

Sort(AddColumns(

GroupBy(Table1, "Zone", "Created"),

"MaxVal",Max(Created,Created)),

MaxVal,Ascending)

 

and

 

SortByColumns(Filter('Table1', Location = DashDropdown.Selected.Value),"Area",Descending)

 

Your formula provides what I need for the most recent of each Zone, I have the existing filter for Location which filters from a dropdown.

Can these be merged?

Hi @DuncanKlysh

try this

 

SortByColumns(

Sort(AddColumns(

GroupBy(Filter('Table1', Location = DashDropdown.Selected.Value), "Zone", "Created"),

"MaxVal",Max(Created,Created)),

MaxVal,Ascending),

"Area", Descending)

 

I'm not sure if this will work.. you just have to play with it to get required result

 

 

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (60,415)