Showing results for 
Search instead for 
Did you mean: 
Not applicable

Change Icon Color based on Inserted Number Value by user connected to excel data source

Hi Experts,


Really appreciate your help on this.


Got a quick question - I have created a survey based on the below excel data source (attached chart). Is there a way to connect:


1. First page: When dropdown menu selected value = 1, Annual volume number value input = 700 which is > 500 (from excel data source)--> clicks submit and leads to second page with icon changes to green light/if lower than 500 changes to red light


And same goes for when selected value = LOB 2 or 3 and with respective total volume from excel data source 


Please let me know if there's any solutions to make this work! Thanks!


Excel data source:



First page:


When click 'submit' button, it will link to second page.


Second page:




Accepted Solutions

@Anonymous If you click on the code with the Red lines, it will tell you what the error is. Can you share a picture of that.

View solution in original post

Super User
Super User

@Anonymous Place this in the Fill property of the round icon,

Replace the control and column name with your names.


      varOldAnnualVolume:Value(LookUp(yourDataSource, LOB=LOBDropdown.Selected.Value).TotalVolume)
    If(varNewAnnualVolume>varOldAnnualVolume, Green, Red)


Not applicable

@CNT Thanks so much for your help. Could you please advise what varNewAnnualVolume and varOldAnnualVolume are referring to? What should I input for var______?

@Anonymous varNewAnnualVolume and varOldAnnualVolume are just variables to hold these values temporarily.


The changes you'll have to make to the formula I had sent earlier are:

AnnualVolumeTextBox - Put the name of your TextInput here

yourDataSource - Put the name of your Excel Table here

LOBDropDown - Put the name of the LOB Dropdown


Hope this helps!

Not applicable

@CNT Got it. Thanks for your help. Had to make several changes to survey - LOB and Commodity type are cascading dropdowns. I'd like icon color to change based on sales tail qty (excel data source) for each commodity type.


Here's what I've typed in (with errors)



Excel data source:





@Anonymous To debug this, lets break it up.

Put the LookUp part of the Code in a Label and see of it is fetching the correct 'Sales Tail Qty' for the selected Commodity.

Not applicable

@CNT Still doesnt seem to work 😞


(varOldAnnualVolume:Value(LookUp(Table1,Commodity=Dropdown1_1.Selected.Result).'Sales Tail Qty'))
If(varNewAnnualVolume>varOldAnnualVolume, Green, Red)

@Anonymous Just put ONLY code this in a Label and check if you are able to see the correct 'Sales Tail Qty' for the selected Commodity. Test this separately.


LookUp(Table1,Commodity=Dropdown1_1.Selected.Result).'Sales Tail Qty'

Not applicable

@CNT yes its working in a label!

@Anonymous That's great. Now could you tell me where exactly where you putting the full code? In which control, in which property?

Helpful resources

Power Apps News & Annoucements carousel

Power Apps News & Announcements

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

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

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 (2,718)