Forum Discussion
One or more tables references a dynamic data source with AzureStorage.DataLake
I'm trying to set up a custom function that dynamically changes the source of my query. Upon saving I get the error 'One or more tables references a dynamic data source'.
Looking for answers online I got the impression there might be some workarounds possible if you are using the Web.Contents function in combination with the RelativePath and Query arguments (although I may be misunderstanding this).
Is there a workaround to available when the AzureStorage.DataLake function is used?
(ADLSPathToLoadFrom) => let
Source = AzureStorage.DataLake(ADLSPathToLoadFrom),
...
2 Replies
- johnbasha33Super User
When using the AzureStorage.DataLake function in Power Query, the data source is considered dynamic, meaning it cannot be used within custom functions or parameterized queries directly.
However, you can work around this limitation by creating a function that accepts the ADLS path as a parameter and then using the function in your query. Here's how you can do it:
- Create a new blank query and define your custom function. This function will accept the ADLS path as a parameter and return the data from that path.
GetDataFromADLS = (ADLSPathToLoadFrom as text) as table =>
let
Source = AzureStorage.DataLake(ADLSPathToLoadFrom)
in
Source
Create another query where you call the custom function with the desired ADLS path.
let
ADLSPath = "your/ADLS/path/here",
Source = GetDataFromADLS(ADLSPath)
in
Source
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!
- Create a new blank query and define your custom function. This function will accept the ADLS path as a parameter and return the data from that path.
- asdfasdfoijdasfFrequent Visitor
Thanks for your response, johnbasha33. When I save query you suggest (GetDataFromADLS), I still get the message 'One or more tables references a dynamic data source'. What am I doing wrong?