cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
matt2
Level: Powered On

Subject: Use Dropdown to Reference a Column

Very new to PowerApps (started this week). Needing some assistance. I have two staffing tables. One is a model based on number of units sold. It is constant and the table is a data source from a SharePoint list. This table should never be edited. The second table allows the user to enter hours for each position.

 

The problem I have comes when comparing the two tables. I've been able to figure out how to pull results from only one row based on the units sold. However, what I also want to do is use a dropdown with the headers (both tables have the same headers) and filter the column based on that. Therefore, when I set the dropdown, I should get 1 and only 1 result from each table (the intersection between the number of units sold row and the column of the chosen value in the dropdown).

 

Any assistance would be greatly appreciated. Thank you

5 REPLIES 5
Super User
Super User

Re: Subject: Use Dropdown to Reference a Column

Hi Matt - I wrote you a long answer and then post crashed. 😞 

 

Will you give me a screenshot or a little more details what you want to do? I am certain we can do it. I am just not sure exactly what you are asking.

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training
matt2
Level: Powered On

Re: Subject: Use Dropdown to Reference a Column

I’ll have to provide sample data as my organization must adhere to HIPAA guidelines.  I start with a staffing table similar to Model Table screenshot.  This counts number of employees needed given a specific number of sales to match our maximum labor percentage.  Then I use a ClearCollect function to have the user input the actual staffing.  The table would like similar to Entered Hours screenshot.  I also separately have the user enter the number of units sold and save this to EnteredUnits.

 

Now that I have all of my data, I need to display only what I need.  I created 2 data tables on one screen.  One links to Model Table.  One links to Entered Hours.  Since the Model Table has multiple rows, I use the function Filter(‘Model Table’, UnitsSold = Value(EnteredUnits)).  This allows me to only see the row from the Model Table that matches the number units sold entered by the user.  However, my results still show all columns that I have checked.  Since I have 12 columns, they don’t all fit.  I would like to use a dropdown menu to select only the one column I wish to see at a time.

 

Also, I know the numbers in the table don’t match up.  I have to do some math to make them match, but that’s easy enough.  My problem only lies with getting one result to display at a time.  Hope this helps!

Super User
Super User

Re: Subject: Use Dropdown to Reference a Column

Yikes. I get it now. I spent way too long and I couldn't come up with a solution. 😞 I will think about it more but no promises. What if you used something other than a DataTable to display the results? Something that would handle 12 columns better? 

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training
matt2
Level: Powered On

Re: Subject: Use Dropdown to Reference a Column

Was there something you had in mind besides a Data Table?  My view of the app is about the size of a phone screen, so I doubt there would be room for anything to display 12 columns.

Super User
Super User

Re: Subject: Use Dropdown to Reference a Column

Ugh. So orginally I was thinking a gallery or form but then I reread and realized you have multiple records in the one table. I tried some creative ideas and I got nothing good. Best idea I have, that I haven't tried, is to use a bunch of If statements (or Switch) so if they pick a column you you change the value for items in the data table to only return specific columns. 

 

Sorry, I am not more help.

 

Shane

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

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