Problème de paramétrage d’un powerbi dans powerbiservice
-
Problème de paramétrage d’un powerbi dans powerbiservice
Bonjour
J’ai un problème avec un powerbi que l’on a transmis qui fonctionne sur mon poste mais que je n’arrive pas à paramétrer dans powerbiservice ( je n’ai pas accès au menu de la passerelle pour ce powerbi , mais pas pour d’autre powerbi)
j’ai ce message d’erreurUnable to determine the data source. When custom connectors are used, the error can happen if gateway doesn’t have the extension enabled. Details: Static analysis failed in gateway. gatewayObjectId:<eupi>46929522-e280-4b75-b94b-c30b689a8b68</eupi>, resultCode:FailedWithUnknownOrUnsupportedDataSources Query contains unsupported function. Function name: AmazonAthena.Databases .
- Data source for Query1
La construction de ce powerbi est specifique au niveau du powerquery
la focntion nativequery est utilisée où on passe 2 arguments
la connexion
la requetemais la connexion est créé dynamiquement dans le script powerquery . Dans la fenetre datasource setting du powerbi aucune connexion n’apparait
let
// Define parameters here for
p_dsn = Text.From(#”ODBC Name – (1)”),
p_environment = Text.From(#”Environment – (1)”),
p_customerNumber = Text.From(#”Customer Number – (1)”),
p_trimOption = Text.From(#”Columns to Include In WarehouseParts – (1)”),
p_populateScenarioOption = #”Populate This Data Model – (1)”,
p_sourceTableName = “vvwarehouseparts”,
p_keyFields = “wwarehousepartsdataid, annualsalesunits”,
p_extendedFields = “wwarehousepartsdataid, warehousecode, warehousedescription”,
p_allFields = “*”,
p_manualFieldList = #”Column Override In WarehouseParts – (1)”,
p_populateData = #”Populate This Data Model – (1)” and #”Populate Warehouse Part Level – (1)”,//******THE REST OF THE QUERY IS STANDARD AND SHOULDN’T BE ALTERED******
// Build the database and schema name dynamically
p_databaseName = p_dsn,
p_schemaName = p_environment & “_c” & p_customerNumber,// Define the time_bucket_function (for PeriodID and unique_key)
time_bucket_function = if #”Reporting Time Bucket – (1)” = “Weekly” then “week” else “month”,// Conditional check to either proceed with merge and expand or return an empty table
PreUniqueTable = if p_populateData then
let
// Load the table containing wimportdateID
t_ImportDateIDFilter= #”DATE Static Primary Import Date – (1)”,// Convert the wimportdateID column to a list
l_importDateIDList = t_ImportDateIDFilter[wimportdateid],// Convert the list to a comma-separated string
p_commaSeparatedIDs = Text.Combine(List.Transform(l_importDateIDList, each Text.From(_)), “, “),// Modify FieldsToInclude based on conditions
p_fieldsToInclude = if p_manualFieldList = “None” then
if p_trimOption = “ALL FIELDS” then p_allFields
else if p_trimOption = “KEY FIELDS ONLY” then
p_keyFields
else
p_extendedFields
else
p_manualFieldList,// Construct the SQL query with dynamic schema name
sqlQuery = “SELECT wwarehousepartid as warehousepartid,
CAST(year(DATE(substring(importdatetime, 1, 10))) AS VARCHAR) || ‘-‘ ||
LPAD(CAST(“& time_bucket_function &”(DATE(substring(importdatetime, 1, 10))) AS VARCHAR), 2, ‘0’) AS PeriodID, “
& p_fieldsToInclude & ” ” &
“FROM ” & p_schemaName & “.” & p_sourceTableName & ” ” &
“WHERE wimportdateid IN (” & p_commaSeparatedIDs & “)”,// Execute the native query
NativeQueryTable = Value.NativeQuery(
AmazonAthena.Databases(p_databaseName, null, []){[Kind=”Database”]}[Data],
sqlQuery,
null,
[EnableFolding=true]
)
in
NativeQueryTable
else
#table({“warehousepartid”, “PeriodID”}, {}),FinalTable = Table.Distinct(PreUniqueTable, {“warehousepartid”}) //warehousepartid
in
FinalTableEst ce que quelqu’un aurait une idée pour rendre ce powerbi compatible avec powerbiservice ?
merci
cordialement
Ludovic
Connectez-vous pour répondre.