Retrieve the Excel Row with the Maximum Value Using Power Automate
Question details
The user needs to find and retrieve the row with the highest value from an Excel table stored in SharePoint using cloud-based Power Automate.

- Product
- Power Automate / Microsoft Excel
- Device & OS
- not provided
- Scenario
- Automating data extraction from an Excel spreadsheet hosted in SharePoint to isolate the row containing the maximum value in a specific column, strictly using a cloud flow without Power Automate Desktop.
- Observed behavior
- The user is seeking the exact cloud flow actions, configurations, or array expressions necessary to successfully locate and retrieve the target row.
Ensure your Excel file is saved in a SharePoint document library or OneDrive for Business, and that the target data is formatted as an official Excel Table, as Power Automate requires defined tables to read rows.
Use Order By and Top Count in Cloud Flow
The most efficient way to find the row with the maximum value is by sorting the Excel table in descending order and retrieving only the top row.
By utilizing the built-in OData query options within the Excel Online connector, you can let Power Automate sort the data during the retrieval process rather than using complex array loops.
In your cloud flow, add the 'List rows present in a table' action. Select your SharePoint site, Document Library, target Excel File, and the specific Table.
Click on 'Show advanced options'. In the 'Order By' field, type the exact internal name of the column you want to evaluate followed by a space and 'desc' (for example: Score desc).
In the 'Top Count' field, enter '1'. This ensures the flow only pulls the single row containing the highest value from your designated column.
Add a subsequent action, such as 'Compose' or 'Send an email', and use the dynamic content from the 'List rows' action to output the data from your maximum value row.

Consult the Power Automate Community for Complex Arrays
If your Excel table exceeds action limits or requires complex array filtering, specialized expressions are needed.
Looking for a Lightweight and Free Alternative to Microsoft Office?
If you manage large datasets, build complex spreadsheets, or simply need robust office software without heavy subscription fees, WPS Office is an excellent choice. It offers high compatibility with Microsoft file formats and a familiar user interface, making your transition seamless.
- 1. Download and Install: Download WPS Office for free from the official website and run the quick installer on your device.
- 2. Open Your Spreadsheets: Launch WPS Spreadsheet and seamlessly open any existing Microsoft Excel files without losing formatting.
- 3. Analyze Data Instantly: Use the familiar interface and extensive formula library to evaluate your data efficiently.

Frequently Asked Questions
Why does Power Automate require an Excel Table to read rows?
Power Automate uses the Microsoft Graph API, which relies on defined named objects like Tables to structure and accurately query data. This prevents the flow from returning blank rows and avoids errors that frequently occur when interacting with dynamic or unformatted cell ranges.
Can I use the max() expression directly on an Excel column in a cloud flow?
You cannot directly apply the max() expression to a column directly from the Excel file source. You must first extract the data using the 'List rows present in a table' action, map the specific numerical column into a flat array using a 'Select' action, and then apply the max() function to that newly created array.
What if the 'Order By' query fails in the Excel connector?
If the OData 'Order By' query throws an error, first ensure you are using the exact internal column name without spaces. If the issue persists due to Excel connector limitations, retrieve all rows using 'List rows present in a table' without advanced options, and use the 'Filter Array' or manual loop actions to process the maximum value in memory.




