Victor
Victor

Reputation: 1205

Query referencing another query

I can't execute a query in Power Query and the error that throws me is like:

Formula.Firewall: Query XXX references other queries or steps, so it may not directly access a data source. Please rebuild this data combination.

The code within this query is as below:

let
    CallToFunction = myFunction,
    #"Invoked Function" = CallToFunction(),
    Source = Oracle.Database("myServer", [Query="SELECT * FROM myTable WHERE CustomerPK IN (" & #"Invoked Function" & ")"])
in
    Source

myFunction is a function that uses a couple of other queries and eventually returns a string of primary keys that I can use to fill in the parenthesis of the WHERE clause of my SQL statement.

When I invoke the function alone it works correctly, so this must be an issue of how to call the function within the last query.

Any ideas?

Upvotes: 1

Views: 4773

Answers (1)

Bda75
Bda75

Reputation: 46

You need to set the privacy settings of your data sources & workbook. See https://support.office.com/en-ca/article/Privacy-levels-Power-Query-cc3ede4d-359e-4b28-bc72-9bee7900b540?ui=en-US&rs=en-CA&ad=CA

Upvotes: 3

Related Questions