Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Gallery add Min to if statment

(0) ShareShare
ReportReport
Posted on by 178

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"
))

 

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

    All good. Figured it out.

     

    Thanks

  • Verified answer
    FLMike Profile Picture
    FLMike 29,105 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 

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,422

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,711

Leaderboard