cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DuncanKlysh
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
Sienna
Resident Rockstar
Resident Rockstar

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)

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
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

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