web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to get the last 4 ...
Power Apps
Unanswered

How to get the last 4 values of a SharePoint column for a line chart

(0) ShareShare
ReportReport
Posted on by 14

Hi,

 

I want to create a line chart within my Power App that shows the last 4 values of a SharePoint column named "Percentage". I am trying to figure out a way to find the last 4 values under the Percentage so that I can use those values as Items for the Line chart.

 

So far I have tried to use Power Automate to grab the last 4 values from the version history using an HTTP Request but it seems clunky. In addition, I do not know how to feed that information into a separate SharePoint column list. 

 

In addition, for my own reasons, I do not have access to Power BI at this time so I am trying to solve this using only Power Apps and Power Automate.

 

Any help would be appreciated!

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Aschana1 

    ClearCollect(_data,ShowColumns(FirstN(Sort(splist,ID,Descending),4),"Percentage"))

    _data will contain the last 4 records for the Percentage field.

  • Aschana1 Profile Picture
    14 on at

    Thank you for this solution and I will be sure to stock this away for future use however I feel I didn't explain myself clearly enough. So I have a SP list where I store people's names and the percent field stores their progress. So say Person A had a percent of 50, 65, 70, 85 across a period of time. The SP list will only show the most recent value (85) but I know that 50, 65, and 70 are stored in Version History. I want to create a collection that has the last 4 values for the percent value for a single row (Person A).

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Aschana1

    I don't think that is possible in PowerApps with the data you have. 

  • Aschana1 Profile Picture
    14 on at

    That makes sense. In Power Automate I have gotten to the point where I have the last 4 values as an array variable but unfortunately I don't know where to go after that. At this time, I want to be able to take those 4 values and write them to a different SP list that has 4 columns (last modified -1, -2, -3, -4). I'm not familiar enough with arrays to proceed.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 326 Most Valuable Professional

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard