0

我在 Power Bi 中使用“导入”连接模式从 SQL 服务器获取数据。
一方面,我可以刷新现有时间段的数据。但是另一方面,一旦在服务器上扩展的数据和新的时间段被添加,具有新时间段的新数据就不会出现在查询中。

我应该只使用“实时连接”还是有其他方法来处理它?

4

1 回答 1

0

You can always set a scheduled refresh in Power BI to accomodate for different times of SQL DB updates.

You can also use Power BI REST APIs to do a 'Refresh Now' using

POST https://api.powerbi.com/v1.0/myorg/groups/{group_id}/datasets/{dataset_id}/refreshes

You can use this Powershell snippet:

# Building Rest API header with authorization token
$authHeader = @{
   'Content-Type'='application/json'
   'Authorization'=$token.CreateAuthorizationHeader()
}

# properly format groups path
$groupsPath = ""
if ($groupID -eq "me") {
    $groupsPath = "myorg"
} else {
    $groupsPath = "myorg/groups/$groupID"
}

# Refresh the dataset
$uri = "https://api.powerbi.com/v1.0/$groupsPath/datasets/$datasetID/refreshes"
Invoke-RestMethod -Uri $uri –Headers $authHeader –Method POST –Verbose

For more info, use Power BI docs: https://powerbi.microsoft.com/en-us/blog/announcing-data-refresh-apis-in-the-power-bi-service/

于 2018-03-13T06:54:56.303 回答