Power Query - Change SQL Datasource Parameter with Multiple Values

MBD

New Member
Joined
Aug 25, 2021
Messages
14
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I've been stuck with this problem for over week - watched and tried numerous methods to no avail. Hoping anyone can help me with this.

I connected a dataset from Microsoft SQL Server to an excel spreadsheet through Power Query.
The problem is, the dataset is so large hence I have to filter the field [_bic_mpaperson] to certain value everytime - and this value changes often.
I'm trying to automatically generate the list and insert it to my SQL query without having to manually change it everytime.

Below is the following query that I used to import the data:
1651630409034.png



I created a VBA macro to generate a list of needed values and call the cell 'SAPList':
1651630751842.png


Then I created a variable in PowerQuery called 'SList' to refer to the named cell above:
1651631357860.png


Then I attempted to use SList as the reference for [_bic_mpaperson] - however it returned with nothing:
1651631293825.png


Could anyone please kindly point out what I've done wrong, and what I can try to fix this?

Regards,

MBD
 

Attachments

  • 1651630981167.png
    1651630981167.png
    24.2 KB · Views: 14

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

Forum statistics

Threads
1,224,817
Messages
6,181,148
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top