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

Most Recent Record per ID

I have a SQL server database with data in the format below:

DateUserIDStatus
5/9/20191active
8/5/20201terminated
7/8/20172active
5/6/20192vacation
9/5/20212terminated
10/5/20183active
8/15/20193vacation
4/8/20203terminated
9/5/20213active

I would like to import into my app only the most recent records.

 

DateIDStatus
8/5/20201terminated
9/5/20212terminated
9/5/20213active

I was able to do this by creating a View in SQL, but Power Apps does not allow you to edit the data or add another line to the original database. Can someone please help?

 

10 REPLIES 10
Jseo
Frequent Visitor

Hi @RandyHayes ,

 

Sorry for bothering you again, but my need has changed a bit on the query you sent before.

Now I am trying to filter the data first to have "Max(Date_ENG)" per Ticker then filter down. Is that possible?

 

Thanks again.

 

 

SortByColumns(
Search(
ForAll(
GroupBy(Filter(Ideas_1, Date_ENG> DateAdd(Today(),-6, Months),QB = "HO",Location = "QB"),
"Ticker", "_records"
),
With({_top: First(Sort(_records, Date_ENG, Descending))},
{Ticker: Ticker,
Date_ENG: _top.Date_ENG,
Analyst: _top.Analyst,
Location: _top.Location,
QB: _top.QB,
L_S:_top.L_S,
MyID:_top.MyID,
Comment: _top.Comment
}
)
),
TextSearchBox1_1.Text,"Analyst","Ticker"),
"Analyst",Descending,"L_S",Ascending,"Ticker",Ascending,"Date_ENG",Descending)

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

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.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

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