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.
Hi
I've a problem refreshing my datasource with my published report & could use some help.
I need to import a CSV file that I can access via an API call. To access this CSV via API, I need to know the ID of the file. To get this ID, I need to first run another API call to find out the latest ID number.
To get the ID, I have the query ReportList. It gives back 1 ID number
let
Source = Xml.Tables(Web.Contents("https://qualysapi.qualys.eu/api/2.0/fo/report/?action=list", [Headers=[Authorization="Basic xxxxxxxxx", #"X-Requested-With"="d"]])),
Table = Source{0}[Table],
#"Changed Type" = Table.TransformColumnTypes(Table,{{"DATETIME", type datetime}}),
REPORT_LIST = #"Changed Type"{0}[REPORT_LIST],
REPORT = REPORT_LIST{0}[REPORT],
#"Changed Type1" = Table.TransformColumnTypes(REPORT,{{"ID", Int64.Type}, {"TITLE", type text}, {"TYPE", type text}, {"USER_LOGIN", type text}, {"LAUNCH_DATETIME", type datetime}, {"OUTPUT_FORMAT", type text}, {"SIZE", type text}, {"EXPIRATION_DATETIME", type datetime}}),
#"Sorted Rows" = Table.Sort(#"Changed Type1",{{"ID", Order.Descending}}),
#"Calculated Maximum" = List.Max(#"Sorted Rows"[ID])
in
#"Calculated Maximum"
In another query, QualysScanResult, I import the CSV file with the ID number found in the query ReportList
let
Source =
Web.Contents(
"https://qualysapi.qualys.eu",
[RelativePath = "/api/2.0/fo/report/",
Headers = [
Authorization="Basic xxxxxxxxx",
#"X-Requested-With"="d"
],
Query = [
action="fetch",
id=Number.ToText(ReportList)
]
]
),
#"Imported CSV" = Csv.Document(Source,[Delimiter=",", Columns=37, Encoding=65001, QuoteStyle=QuoteStyle.None]),
#"Changed Type" = Table.TransformColumnTypes(#"Imported CSV",{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}, {"Column4", type text}, {"Column5", type text}, {"Column6", type text}, {"Column7", type text}, {"Column8", type text}, {"Column9", type text}, {"Column10", type text}, {"Column11", type text}, {"Column12", type text}, {"Column13", type text}, {"Column14", type text}, {"Column15", type text}, {"Column16", type text}, {"Column17", type text}, {"Column18", type text}, {"Column19", type text}, {"Column20", type text}, {"Column21", type text}, {"Column22", type text}, {"Column23", type text}, {"Column24", type text}, {"Column25", type text}, {"Column26", type text}, {"Column27", type text}, {"Column28", type text}, {"Column29", type text}, {"Column30", type text}, {"Column31", type text}, {"Column32", type text}, {"Column33", type text}, {"Column34", type text}, {"Column35", type text}, {"Column36", type text}})
in
#"Changed Type"
I use the RelativePath function & use the paramater id=Number.ToText(ReportList) in the Query section to pass on the ID found in the 1st query.
This setup works fine when refreshing in PowerBI desktop, but when publishing the report I get following error
[Unable to combine data] Section1/QualysScanResult/Remove rows without server name references other queries or steps, so it may not directly access a data source. Please rebuild this data combination.. The exception was raised by the IDbCommand interface. Table: QualysScanResult.
Solved! Go to Solution.
In the settings of semantic model, the cloud connection had to mapped to 'personal cloud connection'
In the settings of semantic model, the cloud connection had to mapped to 'personal cloud connection'
Hi @svendaems ,
Generally this problem is related to the Power BI data privacy levels.
1. You can choose to ignore privacy levels in the options settings. This is the easiest way to get rid of the problem, but it might not be the best solution if you’re dealing with sensitive data.
Understand Power BI Desktop privacy levels - Power BI | Microsoft Learn
2. Chris Webb's has a series of blogs related to this question.
Chris Webb's BI Blog: Data Privacy Settings In Power BI/Power Query, Part 3: The Formula.Firewall Er...
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group
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.