cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kharina
Helper V
Helper V

Get a Column value from the gallery minus a computed value

Dear PowerApps,

 

Please help me fix my formula:

 

kharina_0-1607500334184.png

I have a gallery -that is coming from a sharepoint list. (Gallery 1_1)

 

I want to Subtract the Total Leave Requested (that I got from the date picker) - and I want it to be displayed in my label27.

 

My Dropdown1_2 has the same choices from the Gallery. 

 

I want to display the value of "LeaveType" minus the requested leave (that depends on the type of leave selected from the dropdown). 

 

Can you please help me?

 

Thank You and Kind Regards,

Kharina

4 REPLIES 4
PowerAddict
Super User
Super User

Hi @kharina,

Without knowing which label is Label21_1 and which is Label24_1, it is slightly difficult to suggest you a formula but I am going to attempt: 

LookUp(Gallery1_1.AllItems, Label21_1.Text = Dropdown1_2.Selected.Value).LeaveCount - Label24_1.Text

Here are the assumptions:

1. Label21_1 is the label inside the gallery that displays the leave type

2. In Dropdown1_2.Selected.Value , Value is the name of the column that will give us the leave type name. Once you type in Dropdown1_2.Selected. it will show you suggestions, pick the correct one. 

3. LeaveCount is what I have assumed to be the column name of the data source that populates your gallery. You can replace this with the LabelVacationCount.Text where LabelVacationCount is the name of the label that displays the leave count within your gallery. 

Let me know if this helps. 

---
If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions. 

 

Thanks!

Hardit Bhatia

Microsoft Business Applications MVP

Microsoft Certified Trainer MCT

Blog | Twitter | LinkedIn | Facebook | YouTube  |  Email

 

Hello Mr. Hardit @PowerAddict ,

 

Sorry if my explanation with my concern is confusing. 

I re-created this portion (where I'm having a problem) in another screen:

 

kharina_0-1607910245200.png

 

I am getting this error: invalid argument type. 😞

 

Thank you,

Kharina

Anonymous
Not applicable

Hi @kharina ,

 

Please try this:

LookUp(Gallery1_2.AllItems,Label21_2.Text=Dropdown1_3.Selected.Value).CLB-Label2_7

Hi @Jacky ,

 

Thank you very much.   I thought this is the right solution. However, When I try to change the type of Leave, this formula will subtract for all of the type of Leave from the gallery.
So if I take 1 Vacation Leave, the formula will deduct 1 day from all the type of Leaves from the Gallery. 😞

 

I'm so sorry that I didn't  check the other type of Leave from the dropdown when I accepted your solution - I got too excited. 

 

Thank You and Kind Regards,

Kharina

 

Kind Regards,

Kharina

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,383)