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

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Gallery add Min to if statment

(0) ShareShare
ReportReport
Posted on by 193

Hi,

 

I have the following below code in my gallery which returns a "Yes" in the gallery column Results if all if statements are met.

 

I need to expand on my if statement that for all "Yes" values I must only get the "Yes" value with the least usage and this will be shown in my Results column as "Yes". So technically I should only have one result.

 

usage is a column in my gallery although its based on a calculation.

 

Any help is greatly appreciated

 

If(ThisItem.INDEX <> CountRows(MyCol), 
If( 
 (Month(ThisItem.MY_DATE) >= 10 || 
 Month(ThisItem.MY_DATE) <= 3) &&
 (Month(DateValue(Index(MyCol,ThisItem.INDEX + 1).MY_DATE)) >= 10 || 
 Month(DateValue(Index(MyCol,ThisItem.INDEX + 1).MY_DATE)) <= 3) &&
 Index(MyCol,ThisItem.INDEX + 1).REASON = "25", 
 "Yes",
 "No"
))

 

I have the same question (0)
  • Verified answer
    Michael E. Gernaey Profile Picture
    51,803 Super User 2025 Season 2 on at
    Re: Gallery add Min to if statment

    Hi @christian12 

     

    I responded in depth to your other post of this, can you please answer that one instead of posting another.

     

    This one does not make sense either. 

     

    No this does not return Yes if they are ALL true, it returns Yes it 1 is true && .REASON = "25"

     

    And there is no way to tell you , which one of those lines is Less, based on your code. Nor do I fully understand it anymore than your other thread, where I asked for clarifications.

     

    Please dont ignore responses and then post again.


    If you like my answer, I would really appreciate if you please Mark it as Resolved, and give it a thumbs up, so it can help others

    Cheers

    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey 

  • christian12 Profile Picture
    193 on at
    Re: Gallery add Min to if statment

    All good. Figured it out.

     

    Thanks

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 686 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 433 Super User 2025 Season 2

#3
wolenberg_ Profile Picture

wolenberg_ 266 Moderator

Last 30 days Overall leaderboard