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

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to get the max val...
Power Automate
Answered

How to get the max value from CDS

(0) ShareShare
ReportReport
Posted on by 202

Hi Everyone,

I wanted to get the max value based on the Account sequence.

If you see in the below table, max value in account sequence 1 is 3, similarly for account sequence 2 is also 3  and after getting the max value I need to set it to 0.  

mahmoodhsaud_0-1626703899173.png

Thanks in Advance,

Regards,

Mahmood

Categories:
I have the same question (0)
  • mahmoodhsaud Profile Picture
    202 on at

    Hi @eric-cheng can you help me out with this

  • eric-cheng Profile Picture
    5,171 on at

    Hi @mahmoodhsaud ,

     

    Are you using CDS or Excel?

     

    You can try sorting by the column in descending order and getting the first value?

     

    --------------------------------------------------------------------------
    If I have answered your question, please mark my post as a solution
    If you have found my response helpful, please give it a thumbs up

  • mahmoodhsaud Profile Picture
    202 on at

    Hi @eric-cheng,

    I'm using CDS, the problem is in "Group Sequence" column we'll get more than one max value,

    ex : If group1 has 1,2,3,4 and group2 has 1,2,3... I need to get 4 in group1 and 3 in group2

  • eric-cheng Profile Picture
    5,171 on at

    Hi @mahmoodhsaud ,

     

    Ok, i may have misunderstood you earlier.  You want to get the max group sequence value of each distinct account sequence?

     

    --------------------------------------------------------------------------
    If I have answered your question, please mark my post as a solution
    If you have found my response helpful, please give it a thumbs up

  • mahmoodhsaud Profile Picture
    202 on at

    Yea that's correct and replace the found value with 0

  • Verified answer
    eric-cheng Profile Picture
    5,171 on at

    Hi @mahmoodhsaud ,

     

    You can have a look at this article as its trying to do something similar by grouping and then adding.  In your case, you can look here for getting the max value instead of sum.  You will need to output the rows to an array first.

     

    I was looking at FetchXml and it could potentially be used to group and aggregate or at least group your results first.  However, I dont know it well enough.

     

    --------------------------------------------------------------------------
    If I have answered your question, please mark my post as a solution
    If you have found my response helpful, please give it a thumbs up

      

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 237 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 176 Super User 2026 Season 1

#3
Power Platform 1919 Profile Picture

Power Platform 1919 96 Super User 2026 Season 1

Last 30 days Overall leaderboard