cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

Max Name Items

I have an Excel form like this


ID | Names | Items

1 | Jack | 17

2 | Tim | 40

3 | Tim | 56

4 | Jack | 34

5 | Jack | 12

6 | Tim | 97

 

and I want to set Jack's least amount of items to a variable but I can't get the code right.
Set(leastAmountOfItems,min(lookup(Table1,Names = jack)),Items) or something like this.

4 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User
Super User

Re: Max Name Items

@natmaxex 

Like this...

Set(leastAmountOfItems,Min(Filter(Table1,Names = "Jack"),Items))

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Highlighted
Resolver I
Resolver I

Re: Max Name Items

nope didn't work says:

Behavior function in a non-behavior property. You can't use this property to change values elsewhere in the app.

 

Also, will this work if "item" is "price"? example: 12.57

View solution in original post

Highlighted
Super User
Super User

Re: Max Name Items

@natmaxex 

 

Alternatively just put this code in the Text property without SET

 

Min(Filter(Table1,Names = "Jack"),Items)

 

View solution in original post

Highlighted
Super User
Super User

Re: Max Name Items

@natmaxex 

Suggest you make another post since I might not be able to answer promptly.

View solution in original post

9 REPLIES 9
Highlighted
Super User
Super User

Re: Max Name Items

@natmaxex 

Like this...

Set(leastAmountOfItems,Min(Filter(Table1,Names = "Jack"),Items))

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Highlighted
Resolver I
Resolver I

Re: Max Name Items

nope didn't work says:

Behavior function in a non-behavior property. You can't use this property to change values elsewhere in the app.

 

Also, will this work if "item" is "price"? example: 12.57

View solution in original post

Highlighted
Super User
Super User

Re: Max Name Items

@natmaxex 

It works.  You are getting an error because you can only put it in the properties OnSelect, OnVisible, OnChange, OnStart.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

Highlighted
Super User
Super User

Re: Max Name Items

@natmaxex 

 

Alternatively just put this code in the Text property without SET

 

Min(Filter(Table1,Names = "Jack"),Items)

 

View solution in original post

Highlighted
Resolver I
Resolver I

Re: Max Name Items

I put it in a Lable > text 

Highlighted
Resolver I
Resolver I

Re: Max Name Items

Thanks your the best 😄

Highlighted
Resolver I
Resolver I

Re: Max Name Items

can i ask another question here or do i need to make another post?

Highlighted
Super User
Super User

Re: Max Name Items

@natmaxex 

Suggest you make another post since I might not be able to answer promptly.

View solution in original post

Highlighted
Resolver I
Resolver I

Re: Max Name Items

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (9,083)