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 III
Super User III

@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

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

@natmaxex 

 

Alternatively just put this code in the Text property without SET

 

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

 

View solution in original post

Highlighted

@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 III
Super User III

@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

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

@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

@natmaxex 

 

Alternatively just put this code in the Text property without SET

 

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

 

View solution in original post

Highlighted

I put it in a Lable > text 

Highlighted

Thanks your the best 😄

Highlighted

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

Highlighted

@natmaxex 

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

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

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