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
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

secondImage

New Return to Workplace

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

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,380)