+ Reply to Thread
Results 1 to 9 of 9

Display a specific table based on multiple drop down variables

  1. #1
    Registered User
    Join Date
    07-03-2019
    Location
    Finland
    MS-Off Ver
    365
    Posts
    5

    Display a specific table based on multiple drop down variables

    I am looking to create an excel report that can find and display a specific table out of several tables based on three different variables. The source tables would be populated manually and therefore the issue is how to get a first sheet of the excel to show a specific table.

    In order to clarify, what I want to create:

    - I want to see the hourly sales of a specific business unit on a specific day of a specific week.
    - The tables would be built so that we have the opening hours on the rows and the sales figures on a specific column.
    - The source data would include a table for instance Business Unit A on Monday and on a Week 24 (As you can imagine there would be dozens of tables in the source data).
    - I want to fetch that specific table from the large number of source tables by selecting variables in three dropdown menus, first for Business Unit, second for Weekday and third for Week Number
    - Only upon selecting all three variables from the three dropdown menus would a table be fetched from the several different source tables and displayed on the first sheet under the dropdown menus


    How would I need to go about creating something like this? Please help excel gurus.
    Last edited by Firpow; 07-04-2019 at 09:58 AM.

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Display a specific table based on multiple drop down variables

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    07-03-2019
    Location
    Finland
    MS-Off Ver
    365
    Posts
    5

    Re: Display a specific table based on multiple drop down variables

    Absolutely. Attached is a desensitized table with explanations of what I am trying to achieve.
    Attached Files Attached Files

  4. #4
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Display a specific table based on multiple drop down variables

    It's really easy to combine and report on the data from multiple tables using Power Query. In your case, you need to do a little work to prepare the tables, first of all.

    This VBA code will rename each table of source data, based on the Business Unit / Weekday / Week Number data above the table, then it will compile the list of new table names into another table:
    Please Login or Register  to view this content.

    Now we can use Power Query to combine the data from the source tables, and use this combined data as a data model source, for the consolidated report:
    Please Login or Register  to view this content.
    Finally, just insert a pivot table onto the Report sheet, with filters on Business Unit, Weekday and Week Number.

    See attachment for worked example.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    07-03-2019
    Location
    Finland
    MS-Off Ver
    365
    Posts
    5

    Re: Display a specific table based on multiple drop down variables

    Thank you, this seems to do exactly what I want.

    As I do not know my way around Power Query, would you happen to have easy steps available or even a link to a set tutorial so I could adapt this to the actual file?

  6. #6
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Display a specific table based on multiple drop down variables

    Have a look at the video in my signature, for how to use the provided Power Query code in your workbook.

  7. #7
    Registered User
    Join Date
    07-03-2019
    Location
    Finland
    MS-Off Ver
    365
    Posts
    5

    Re: Display a specific table based on multiple drop down variables

    Thanks, I worked out how to do power query code.

    The process is still a little unclear to me. I have used the example excel to try and work based on that. I have changed all the headers in the source data and in Power Query code as well as renamed the tables in the name editor. I still see that the source data in the Power Query still displays the old table names as source data and therefore the queries do not work. How do I change this source data?

  8. #8
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Display a specific table based on multiple drop down variables

    We needed to compile a list of tables for Power Query to both loop through, and get the business unit / weekday / week number data from (as that data is not in the tables.) That's what the VBA code does - it loops through all the "Branch" worksheets, renames each table to include the business unit / weekday / week number data, and adds the (new) table name to a table on hidden worksheet "Parameters".

    Power Query looks at the table on hidden sheet "Parameters" to get the list of table names, then combines data from each of those tables.

    So if you're using a different sheet / table structure, run the VBA code first, to recompile the TableList table on the "Parameters" sheet.

    Make sense?

  9. #9
    Registered User
    Join Date
    07-03-2019
    Location
    Finland
    MS-Off Ver
    365
    Posts
    5

    Re: Display a specific table based on multiple drop down variables

    It does! I got it working, thank you so much for your assistance

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Creating a dynamic array to display multiple specific entries based on criteria
    By Travisty in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 09-15-2017, 09:43 AM
  2. [SOLVED] create a drop down which allows multiple selection and change content of table based on th
    By melody10 in forum Excel Programming / VBA / Macros
    Replies: 24
    Last Post: 08-16-2015, 06:12 AM
  3. Replies: 0
    Last Post: 09-29-2014, 10:32 AM
  4. [SOLVED] Look up value in a table based on multiple variables
    By 00pumpkin in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-09-2014, 10:38 AM
  5. [SOLVED] Drop Down Data Validation - Display a result based on multiple conditions
    By carlmf1987 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-25-2013, 01:50 PM
  6. Creating automatic/dynamic drop down lists from a table with multiple variables
    By bobby.bobby in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-09-2013, 09:55 AM
  7. Multiple results to display based on selection made from drop down list
    By scoot_eruk in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-16-2012, 05:03 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1