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
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

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

Top Solution Authors
Top Kudoed Authors
Users online (8,816)