Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Chris Webb wrote this great blog:
I have 3 parameters in my Power BI Service Dataflow. I manually addede the parameters to the M-Code and the query works, until I make a function of it whereby I pass multiple parameters to it then I cannot save the dataflow, and get the following error:
One or more tables references a dynamic data source.
My code looks as follows:
"Web.Contents("http://jsonplaceholder.typicode.com/comments",[Query=[postId={"1","2"}]])"Solved! Go to Solution.
Hi @jannie ,
Since the ticker is not a parameter in the Yahoo Finance API (like period1, period2 and interval are) you cannot follow the approach of [Query=[...
Instead, you can used directly the RelativePath approach :
let
Source = Csv.Document(Web.Contents("https://query1.finance.yahoo.com/v7/finance/download/", [RelativePath=prmTicker & "?period1="& prmStartDate & "&period2=" & prmEndDate & "&interval=1d"]),[Delimiter=",", Columns=7, Encoding=65001, QuoteStyle=QuoteStyle.None])
in
Source
For documentation, if ticker was a parameter and you wanted to use the [Query=[... approach it will be like this:
let
Source = Csv.Document(Web.Contents("https://query1.finance.yahoo.com/v7/finance/download/TSLA", [Query=[ticker = prmTicker, period1= prmStartDate, period2= prmEndDate, interval="1d"]]),[Delimiter=",", Columns=7, Encoding=65001, QuoteStyle=QuoteStyle.None])
in
Source
Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudo 👍
Thanks!
You can also check out my LinkedIn!
Best regards,
Jorge Pessoa
Hi @jannie ,
Since the ticker is not a parameter in the Yahoo Finance API (like period1, period2 and interval are) you cannot follow the approach of [Query=[...
Instead, you can used directly the RelativePath approach :
let
Source = Csv.Document(Web.Contents("https://query1.finance.yahoo.com/v7/finance/download/", [RelativePath=prmTicker & "?period1="& prmStartDate & "&period2=" & prmEndDate & "&interval=1d"]),[Delimiter=",", Columns=7, Encoding=65001, QuoteStyle=QuoteStyle.None])
in
Source
For documentation, if ticker was a parameter and you wanted to use the [Query=[... approach it will be like this:
let
Source = Csv.Document(Web.Contents("https://query1.finance.yahoo.com/v7/finance/download/TSLA", [Query=[ticker = prmTicker, period1= prmStartDate, period2= prmEndDate, interval="1d"]]),[Delimiter=",", Columns=7, Encoding=65001, QuoteStyle=QuoteStyle.None])
in
Source
Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudo 👍
Thanks!
You can also check out my LinkedIn!
Best regards,
Jorge Pessoa
Excellent thanks Jorge it works perfectly and I now understand the syntax.
All the best
Jannie
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 29 | |
| 23 | |
| 18 | |
| 17 | |
| 14 |