Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
cshepler
Helper II
Helper II

Formula.Firewall Error using CSV string in (step 'Source').

ErrorMessage: Query 'Query1' (step 'Source') references other queries or steps, so it may not directly access a data source. Please rebuild this data combination.

 

DataSource Settings:

1) "Database connection is set to PUBLIC."

2) "CSV connection is set to PUBLIC."

 

DataSources Being used:

1) SQL Server database query. (Query1)

2) CSV File converted to a String. (Query1List)

 

We Have 2 queries:

Query1 (This Query is the SQL database connection which is using the Query1List data from the CSV.)

PowerBIQuery1.png

 

PowerBIQuery1_Error.png
Query1List (This Query is just just converting the CSV data into a consumable string.)

PowerBIQuery1list.PNG

 

I must resolve this firewall error in order to propperly schedule a refresh window for this data.
How can I allow for the use of 2 data sources within the "Source" step of Query1?

I've read the blog posts telling me to seperate the two queries. It's impossible to execute "Query1" without the IN CLAUSE. 

 

If you need more context just ask.

1 ACCEPTED SOLUTION

Hi @cshepler,

How about add custom steps to get data from CSV file and invoke SQL connector in same query table?

For example:

let
	list=Csv.Document(File.Contents("xxxxxxxx")),
	merge="'"& Text.Combine(list,"','")&"'",
	Source=Sql.Database("xxxxxxx","xxxx",[Query="select xxx from xxx where code in ("&merge&")")
in
	Source

Notice: please setting 'data privacy' to 'public' to prevent the error of cross source invoke.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

4 REPLIES 4
parry2k
Super User
Super User

@csheplercreate a separate list for CSV and then use that list in your SQL query, read this post if it helps.

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k 

 

I took your advice and still get the same message. 

See Below, 

 

Query #1:

We start with "csvTestCodes". (This query is just the Table returned from the .csv file.)

PowerBI_csvTestCodes.png

 

 

Query #2:

We move to "listTestCodes" second. (This query we are converting, csvTestCodes into a List instead of a Table.)

PowerBI_listTestCodes.PNG

 

Query #3: 

Now that we have a list of Test Codes we convert it to a string with "TestCodesString".

PowerBI_TestCodesString.PNG

 

Query #4

Lastly, we pass the "TestCodesString" into Query1.

PowerBI_Query1_UPDATE.png

 

 

Hopefully you have more advice. I've already read that blog post you attached and it's not working for me unless the steps I've followed above are wrong???

 

Regards

 

 

 

 

 

Hi @cshepler,

How about add custom steps to get data from CSV file and invoke SQL connector in same query table?

For example:

let
	list=Csv.Document(File.Contents("xxxxxxxx")),
	merge="'"& Text.Combine(list,"','")&"'",
	Source=Sql.Database("xxxxxxx","xxxx",[Query="select xxx from xxx where code in ("&merge&")")
in
	Source

Notice: please setting 'data privacy' to 'public' to prevent the error of cross source invoke.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

@v-shex-msft 

 

Can you please also show me an example of the same thing but using a SQL datasource which returns just 1 database field? 

 

Thanks!!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.