cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
corina
Advocate I
Advocate I

filtering latest data from excel into gallery

can somebody please help: i am developing a covid-19 tracker app for my company. I have a table in which data is entered. in some circumstances, one single employee has been sent home on different occasions, each one of these occasions we mark as a "case".

Example: 

employee: zach west. went home with a fever on 6/29/2020 and again on 10/1/2020. each date marks a different case. each case requires a series of testing. ("initial test", and possibly 3 follow up tests depending on the results.)

 

when test results are given, the user will search the employee and update with results BUT for the specific case. (Zach went home on 6/29 and 10/1 but we want to update 10/1's case). I have a combobox filtering to a gallery which i want to show the latest or ALL dates for the initial testing

corina_0-1605899750388.png

this is the table (titled cases) it reads from (filtered):

corina_1-1605899927366.png

 

in my gallery: i have text labels to pull test dates. formula is:

Text(ThisItem.'Initial Test Date'+1, "[$-en-US]mm/dd/yyyy")

 

 gallery filtered formula: Filter(cases, 'Employee ID' = update_empID_3.Selected.Employee) 

the combobox is: update_empID_3 

 

if you look at the table i need it to pull the LATEST record for his testing so they can see his testing history.

THANK YOU!

 

 

2 REPLIES 2
timl
Super User
Super User

Hi @corina 

If you just want your gallery to display the single last record that was created for the user, you can sort your items in date descending order and call the first function to return the first record.

The formula you would use would look like this:

First(
       SortByColumns(Filter(cases, 'Employee ID' = update_empID_3.Selected.Employee) ,
                     'Initial Test Date',
                     Descending
       )
)



gabibalaban
Super User
Super User

Hi @corina,

From my understanding the gallery under "testing history" should show All the employee records based on your formula:

Filter(cases, 'Employee ID' = update_empID_3.Selected.Employee) 

I'm not quite sure why your gallery has only one record.

If you want that the gallery to have only one record and this one to be the last (newest) record of a specific employee is guess this formula will give you the desired result:

Last(Sort(Filter(cases, 'Employee ID' = update_empID_3.Selected.Employee),'Last Date Worked',Ascending))

Can you tell me why do you used "+1" ?

Text(ThisItem.'Initial Test Date'+1, "[$-en-US]mm/dd/yyyy")

 

Hope it helps !

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,396)