Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hi,
I've tried all suggested solutions on this error, but none worked.
I have this line of code in my query:
let
Date1 = StartDatePar,
Date2 = EndDatePar,
Source = Odbc.Query("dsn=SnowFlake", "select * from table
where 1=1 #(lf)
and SALE_DATE >= " & Date1 & "
and SALE_DATE < " & Date2 & "
")
in
Source
As you can see there are power query parameters that are used directly in the snowflake query. I can't refresh it because I get this error:
Query 'Raport' (step 'Source') references other queries or steps, so it may not directly access a data source. Please rebuild this data combination.
Here are all steps:
All source code permissions are set to "None". Is there a way to maybe edit the code to make it work?
What is the reason behind this error?
Please help me, I'm losing my head over this.
I understand the problem and thanks for an interesting article, but it doesn't provide solution to my problem. The article says:
To resolve, the code that combines between sources can’t be in the same partition as the sources and incompatible sources can’t be together in the same partition. The key to adjusting code to comply with these requirements is understanding where partition boundaries are drawn.
Unfortunately, the rules that define how code is partitioned are complex. A shortcut solution: If you encounter one of these errors, place the code specific to each data source in a separate query (one query per data source) and then reference those queries from another query that combines between them.
Great. So I need to adjust my code and to be able to do that I need to understand more about partitions. The article doesn't say a word about how code is partitioned because it's "complex". It only provides a shortcut solution. In my case I don't know how to execute a shortcut solution and put one query per data source because I need to reference queries WITHIN the code right in the middle of it.
The article also says that I can set privacy settings to "Public" but as I said in the post - it doesn't work.
So no solution for me.
Use Odbc.DataSource instead of Odbc.Query and then provide the query later via Value.NativeQuery
Hi, I think I'm pretty close with my code, would you be willing to help me? I'd be very grateful.
Can't offer much more. Maybe this can help: Troubleshooting an ODBC-based Power Query connector - Power Query | Microsoft Learn
Here is how I did it:
let
// Step 1: Establish the connection using Odbc.DataSource
Source = Odbc.DataSource("dsn=SnowFlake"),
// Step 2: Define the query using Value.NativeQuery
Result = Value.NativeQuery(
Source,
"select * from table
WHERE 1=1
AND SALE_DATE >= '" & StartDatePar & "'
AND SALE_DATE < '" & EndDatePar & "'
"
)
in
Result
I get either the same error or this one: