web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Need help retrieving d...
Power Apps
Answered

Need help retrieving data from variable columns [LOOKUP]

(0) ShareShare
ReportReport
Posted on by 7

Dear all, 

 

I have the following table:

jobgoud_0-1681913085074.png

My application has two combo boxes and one label:

1. The first combo box has for Items the option to chose between [1,2,3]

2. The second combo box has for Items the option to chose between ["Aarde","Water", "Vuur"]

3. The label has currently the following formula: LookUp(Table1,Column1=ComboBox1.Selected.Value,Aarde)

 

For values in Column 1 with the formula:
1, the results label shows 10

2, the results label shows 20  

3, the results label shows 30  

 

I cannot seem to make the formula variable to combo box 2 ["Aarde","Water", "Vuur"], as it seems I can only get a working formula when I hardcode the values rather than variable with combo box 2.

 

I also tried with creating a label using formula Concat(ComboBox1.SelectedItems,ThisRecord.Value) and to reference the formula to this label, LookUp(Table1,Column1=ComboBox1.Selected.Value,Label1), but then my results are only Combobox1. 

 

EDIT: I also tried to store a variable colName in LookUp(Table1, Column1 = ComboBox1_1.Selected.Value, colName), but the label still shows me only the combo box 2 value.

 

Thank you all in advance

Categories:
I have the same question (0)
  • Verified answer
    NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    Hi @jobgoud ,
    You can try using below formula in Text property of label (as columns cannot be referenced dynamically) - 
    Switch(ComboBox2.Selected.Value, "Aarde", LookUp(Table1,Column1=ComboBox1.Selected.Value,Aarde), "Water", LookUp(Table1,Column1=ComboBox1.Selected.Value,Water) , "Vuur", LookUp(Table1,Column1=ComboBox1.Selected.Value,Vuur) )

  • jobgoud Profile Picture
    7 on at

    Hi @NandiniBhagya20 

     

    I appreciate your help. Your solution works well for this test case.

     

    However, I need to apply it to a larger and more complicated data set (up to 50 rows and 99 columns) with a zip code format of 2-digits for European countries. UK is the exception, but they can be converted to 2-digit codes as well. How can I handle this issue?

     

    I will try your solution, but I’m not sure if it’s efficient and convenient enough for my data set. Is there a way to make it more dynamic?

     

    Thank you in advance, 

     

  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    Hi @jobgoud ,
    Apologies, dynamic column filtering is currently not supported as per my knowledge. Instead of creating column for each country code, you can use dropdown control which will have country value and a text input which will have code value.

  • jobgoud Profile Picture
    7 on at

    Hi @NandiniBhagya20,

     

    The thing is, I need to showcase data based on the row (number) and column (zipcode).

    So the thing is, Row (3) + Vuur should be 60 and I don't see how a dropdown control can be used in this case?

     

    Thanks 🙂

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard