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.
Anyone has same issue? I want to create template app and publish it.
Here's my scenario. I created pbix file from power bi desktop. I definitely added parameters by using Query Editor, and save as pbix file. And then I created workspace from power bi service and tried to create contents by uploading pbix file. However, I can't type values for parameters.
= Python.Execute("import requests#(lf)import csv#(lf)import json#(lf)import pandas as pd#(lf)#(lf)response = requests.post(#(lf) 'https://data.thinknum.com/connections/dataset/" & dataset_id & "/query/new',#(lf) headers={#(lf) ""Authorization"": ""token " & token & """,#(lf) ""X-API-Version"": ""20151130"",#(lf) ""Accept"": ""application/json""#(lf) },#(lf) data={#(lf) ""request"": json.dumps({#(lf) ""tickers"": [],#(lf) ""filters"": []#(lf) }),#(lf) ""start"": " & start & ",#(lf) ""limit"": " & limit & "#(lf) }#(lf))#(lf)result = json.loads(response.text)#(lf)columns = [""{}({})"".format(item['display_name'], item['id']) for item in result['items']['fields']]#(lf)rows = result['items']['rows']#(lf)df = pd.DataFrame(rows, columns=columns)#(lf)print df")
I actually used python script and parameters seems not working from python script. Any ideas?
Hi @sangwonseo ,
Sorry for our late reply, we are not good at python script, Could you please try to save the query out side the function and execute as following?
let
script = ........... ,
Source = Python.Execute(script)
in
Source
We suggest you to delete the query if it contain any confidential information.
Best regards,
Hi @sangwonseo ,
If you are using the parameter in the Web.Contents function, such as following:
let
Source = Json.Document(Web.Contents("https://api.powerbi.com/v1.0/myorg/groups/" & id &"/datasets/" & [datasetid] & "/refreshes",[Headers=[Authorization="Bearer " & TokenParameter]]))
in
Source
Try to use the Relative Path parameter to included all the dynamic part of the url, such as following
let
Source = Json.Document(Web.Contents("https://api.powerbi.com/v1.0/myorg/groups/",[RelativePath=id &"/datasets/" & [datasetid] & "/refreshes",Headers=[Authorization="Bearer " & TokenParameter]]))
in
Source
Best regards,
Thanks for reply. But I am using Python script and it seems not working.
Hi @sangwonseo ,
How about the result after you follow the suggestions mentioned in my original post?Have you tried to use the Web.Contents to call the api that you called in your python script?
Best regards,
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.