管理您的資料來源─Analysis ServicesManage your data source - Analysis Services

安裝內部部署資料閘道之後,您必須新增可搭配閘道使用的資料來源。Once you have installed the on-premises data gateway, you will need to add data sources that can be used with the gateway. 本文將探討如何使用閘道和資料來源。This article will look at how to work with gateways and data sources. 您可以針對已排程的重新整理或即時連線,使用 Analysis Services 資料來源。You can use the Analysis Services data source either for scheduled refresh or for live connections.

下載並安裝閘道Download and install the gateway

您可以從 Power BI 服務下載閘道。You can download the gateway from the Power BI service. 選取 [下載] > [資料閘道],或移至 [gateway download page] (閘道下載頁面)Select Downloads > Data Gateway, or by going to the gateway download page.

Analysis Services 即時連線的限制Limitations of Analysis Services live connections

您可以使用即時連線針對表格式或多維度執行個體。You can use a live connection against tabular or multidimensional instances.

伺服器版本Server version 必要的 SKURequired SKU
2012 SP1 CU4 或更新版本2012 SP1 CU4 or later 商業智慧和企業版 SKUBusiness Intelligence and Enterprise SKU
20142014 商業智慧和企業版 SKUBusiness Intelligence and Enterprise SKU
20162016 標準 SKU 或更高版本Standard SKU or higher
  • 不支援資料格層級格式化與轉譯功能。Cell level Formatting and translation features are not supported.
  • 動作和命名集不會公開至 Power BI,但您仍然可以連接至同樣包含動作或命名集的多維度 Cube,然後建立視覺效果和報表。Actions and Named Sets are not exposed to Power BI, but you can still connect to multidimensional cubes that also contain Actions or Named sets and create visuals and reports.

加入閘道Add a gateway

若要新增閘道,只要下載閘道並在您環境中的伺服器即可。To add a gateway, simply download and install the gateway on a server in your environment. 安裝閘道之後,它會顯示在 [管理閘道] 底下的閘道清單中。After you have installed the gateway, it will show in the lists of gateways under Manage gateways.


您必須是至少一個閘道的管理員,才會顯示 [管理閘道]。Manage gateways will not show up until you are the admin of at least one gateway. 當以管理員身分加入閘道時,或者當您安裝並設定閘道時,就會發生這種情況。This can happen either by being added as an admin or you installing and configuring a gateway.

移除閘道器Remove a gateway

移除閘道器的同時也會刪除該閘道器下的所有資料來源。Removing a gateway will also delete any data sources under that gateway. 這也會中斷依賴這些資料來源的任何儀表板和報表。This will also break any dashboards and reports that rely on those data sources.

  1. 選取右上角的齒輪圖示 > [管理閘道] 。Select the gear icon in the upper-right corner > Manage gateways.
  2. [閘道] > [移除]Gateway > Remove

加入資料來源Add a data source

您可以選取閘道並按一下 [加入資料來源],或移至 [閘道] > [加入資料來源] ,以加入資料來源。You can add a data source by either selecting a gateway and click Add data source, or go to Gateway > Add data source.

您可以接著從清單中選取 [資料來源類型] 。You can then select the Data Source Type from the list. 如果您連接到多維度或表格式伺服器,請選取 [Analysis Services]。Select Analysis Services if you are connecting to either a Multidimensional or Tabular server.

您接著需要填入資料來源的資訊,包括 伺服器資料庫You will then want to fill in the information for the data source which includes the Server and the Database.

閘道器將使用您輸入的 使用者名稱密碼 連接到 Analysis Services 執行個體。The Username and Password that you enter will be used by the gateway to connect to the Analysis Services instance.


您輸入的 Windows 帳戶,必須擁有您所連接執行個體的伺服器系統管理員權限。The Windows account you enter must have Server Administrator permissions for the instance you are connecting to. 如果此帳號的密碼設有期限,在密碼未針對資料來源更新的情況下,使用者就會收到連接錯誤。If this account’s password is set to expire, users could get a connection error if the password isn’t updated for the data source. 如需詳細資訊,請參閱主要內部部署資料閘道文章,以深入了解認證的儲存方式。For more information, see the main on-premises data gateway article to learn more about how credentials are stored.

您可以在填入所有內容之後,按一下 [加入] 。You can click Add after you have everything filled in. 您現在可以使用此資料來源,針對內部部署的 Analysis Services 執行個體,用於已排程的重新整理或即時連線。You can now use this data source for scheduled refresh, or live connections, against an Analysis Services instance that is on premises. 如果成功,您會看到「連接成功」 。You will see Connection Successful if it succeeded.

進階設定Advanced settings

您可以設定資料來源的隱私權等級,You can configure the privacy level for your data source. 如此可控制如何混搭資料。This controls how data can be mashed up. 這只能用於已排程的重新整理。This is only used for scheduled refresh. 不適用於即時連線。It does not apply to live connections. 深入了解Learn more

Analysis Services 與使用者名稱Usernames with Analysis Services

每次使用者和連接至 Analysis Services 的報表互動時,會將有效使用者名稱傳遞至閘道器,然後傳到內部部署 Analysis Services 伺服器。Each time a user interacts with a report connected to Analysis Services, the effective username is passed to the gateway and then onto your on-premises Analysis Services server. 您用以登入 Power BI 的電子郵件地址即為當作有效使用者傳遞給 Analysis Services 的內容。The email address, that you sign into Power BI with, is what we will pass to Analysis Services as the effective user. 傳遞此內容時是使用連接屬性 EffectiveUserNameThis is passed in the connection property EffectiveUserName. 此電子郵件地址應符合本機 Active Directory 網域內定義的 UPN。This email address should match a defined UPN within the local Active Directory Domain. UPN 是 Active Directory 帳戶的屬性。The UPN is a property of an Active Directory account. 接著,該 Windows 帳戶就必須出現於 Analysis Services 角色中。That Windows account then needs to be present in an Analysis Services role. 如果找不到任何相符項目,Active Directory 的登入即失敗。If a match cannot be found, in Active Directory, the login will not be successful. 深入了解Learn more

您也可以將您的 Power BI 登入名稱與本機目錄 UPN 對應。You can also map your Power BI sign in name with a local directory UPN. 深入了解Learn more

如何判斷我的 UPN 為何?How do I tell what my UPN is?

您可能不知道您的 UPN 為何,且您可能不是網域系統管理員。You may not know what your UPN is, and you may not be a domain administrator. 您可以從工作站使用下列命令來查明您帳戶的 UPN。You can use the following command from your workstation to find out the UPN for your account.

whoami /upn

結果看起來類似電子郵件地址,但這是您網域帳戶上的 UPN。The result will look similar to an email address, but this is the UPN that is on your domain account. 如果您使用 Analysis Services 資料來源進行即時連線,而且如果這不符合您登入 Power BI 的電子郵件地址,您可能想要看看如何對應使用者名稱If you are using an Analysis Services data source for live connections, and If this doesn't match the email address you sign into Power BI with, you may want to look at how to Map user names.

對應使用者名稱Map user names

您可以使用兩種不同的方式對應 Analysis Services 的使用者名稱:You can map user names for Analysis Services in two different ways:

  1. 手動使用者重新對應Manual user re-mapping
  2. 可將 AAD UPN 重新對應至 Active Directory 使用者的內部部署 Active Directory 屬性查閱 (AD 查閱對應)On-premises Active Directory Property Lookup to remap AAD UPNs to Active Directory users (AD Lookup mapping)

雖然可以使用第二種方法執行手動對應,但是這麼做十分耗時且很難維護;在模式比對不足時特別困難,例如,AAD 與內部部署 AD 之間的網域名稱不同時,或 AAD 與 AD 之間的使用者帳戶名稱不同時。While it's possible to perform manual mapping using the second approach, doing so would be time consuming and difficult to maintain; it's especially difficult when pattern matching doesn't suffice--such as when domain names are different between AAD and on-premises AD, or when user account names are different between AAD and AD. 因此,不建議使用第二種方法進行手動對應。As such, manual mapping with the second approach is not recommended.

我們將在下列兩節依序描述這兩種方法。We describe these two approaches, in order, in the following two sections

手動使用者名稱重新對應Manual user name re-mapping

針對 Analysis Services 資料來源,您可以設定自訂使用者主題名稱 (UPN) 規則。For Analysis Services data sources, you can configure custom User Principal Name (UPN) rules. 如果您的 Power BI 服務登入名稱不符合您的本機目錄 UPN,可以使用這個方式解決。This will help you if your Power BI service login names do not match your local directory UPN. 例如,若您使用 john@contoso.com 登入 Power BI,但您的本機目錄 UPN 為 john@contoso.local,您可以設定對應規則以將 john@contoso.local 傳遞到 Analysis Services。For example, if you sign into Power BI with john@contoso.com, but your local directory UPN is john@contoso.local, you can configure a mapping rule to have john@contoso.local passed to Analysis Services.

若要前往 UPN 對應畫面,請執行步驟。To get to the UPN Mapping screen, do the following.

  1. 移至齒輪圖示,然後選取 [管理閘道]。Go to the gear icon and select Manage Gateways.
  2. 請展開包含 Analysis Services 資料來源的閘道。Expand the gateway that contains the Analysis Services data source. 或者,若您尚未建立 Analysis Services 資料來源,可以暫時先這麼做。Or, if you haven't created the Analysis Services data source, you can do that at this point.
  3. 請選取資料來源,然後選取 [使用者] 索引標籤。Select the data source and then select the Users tab.
  4. 請選取 [對應使用者名稱]。Select Map user names.

然後,您會看到加入規則及測試指定使用者的選項。You will then see options to add rules as well as test for a given user.


您可能會不小心變更無意更動的使用者。You may inadvertently change a user that you didn't intend to. 例如,如果您的取代 (原始值) 是 @contoso.com,而您的**使用 (新名稱)** 是 @contoso.local,之後 @contoso.local 將會取代所有登入包含 @contoso.com 的使用者。For example, if your Replace (original value) is @contoso.com and your With (New name) is @contoso.local, all users with a sign in that contains @contoso.com will then be replaced with @contoso.local. 此外,如果您的代替 (原始名稱)為 dave@contoso.com,而您的使用 (新名稱)為 dave@contoso.local,具有 v-dave@contoso.com登入的使用者會作為 v-dave@contoso.local 傳送。Also, if your Replace (Original name) is dave@contoso.com and your With (New name) is dave@contoso.local, a user with the sign in of v-dave@contoso.com would be sent as v-dave@contoso.local.

AD 查閱對應AD lookup mapping

若要執行內部部署 AD 屬性查閱以將 AAD UPN 重新對應至 Active Directory 使用者,請遵循本節中的步驟。To perform on-premises AD property lookup to re-map AAD UPNs to Active Directory users, follow the steps in this section. 若要開始,請檢閱這項作業的運作方式。To begin with, let's review how this works.

在 [Power BI 服務] 中,發生下列情況:In the Power BI service the following occurs:

  • 針對 Power BI AAD 使用者對內部部署 SSAS 伺服器的每個查詢,會一起傳遞 UPN 字串,例如:firstName.lastName@contoso.comFor each query by a Power BI AAD user to an on-premises SSAS server, a UPN string is passed along, such as: firstName.lastName@contoso.com


將使用者名稱字串傳送至內部部署資料閘道「之前」,仍然會套用 Power BI 資料來源設定中所定義的任何手動 UPN 使用者對應。Any manual UPN user mappings defined in the Power BI data source configuration are still applied before sending the user name string to the on-premises data gateway.

在具有可設定自訂使用者對應的內部部署資料閘道上,執行下列動作:On the on-premises data gateway with configurable Custom User Mapping, do the following:

  1. 尋找要搜尋的 Active Directory (自動或可設定)Find Active Directory to search (automatic, or configurable)
  2. 透過 Power BI 服務根據連入的 UPN 字串 (“firstName.lastName@contoso.com”) 來查閱 AD 人員屬性 (例如 Email)。Look up the attribute of the AD Person (such as Email) based on incoming UPN string (“firstName.lastName@contoso.com”) from the Power BI service.
  3. 如果 AD 查閱失敗,則會嘗試使用一起傳遞的 UPN 作為 SSAS 的 EffectiveUser。If the AD Lookup fails, it attempts to use the passed-along UPN as EffectiveUser to SSAS.
  4. 如果 AD 查閱成功,則會擷取該 AD 人員的 UserPrincipalNameIf the AD Lookup succeeds, it retrieves UserPrincipalName of that AD Person.
  5. 它會將 UserPrincipalName 電子郵件傳遞為 SSAS 的 EffectiveUser,例如:Alias@corp.on-prem.contosoIt passes the UserPrincipalName email as EffectiveUser to SSAS, such as: Alias@corp.on-prem.contoso

如何設定您的閘道執行 AD 查閱:How to configure your gateway to perform the AD Lookup:

  1. 下載並安裝最新閘道Download and install the latest gateway
  2. 在閘道中,您需要使用網域帳戶來變更要執行的內部部署資料閘道服務 (而非本機服務帳戶;否則在執行階段,AD 查閱將無法正常運作)。In the gateway, you need to change the on-premises data gateway service to run with a domain account (instead of a local service account – otherwise the AD lookup won’t work properly at runtime). 您必須重新啟動閘道服務,變更才會生效。You'll need to restart the gateway service for the change to take effect. 前往您電腦上的閘道應用程式 (搜尋 “on-premises data gateway” 或「內部部署資料閘道」)。Go to the gateway app on your machine (search for “on-premises data gateway”). 若要這樣做,請移至 [服務設定] > [變更服務帳戶]。To do this, go to Service settings > Change service account. 除非您想要改為建立新的閘道,否則請確定您有此閘道的修復金鑰,因為您必須在相同的電腦上才能進行還原。Make sure you have the recovery key for this gateway, since you'll need to restore it on the same machine unless you want to create a new gateway instead.
  3. 以系統管理員身分巡覽至閘道的安裝資料夾 C:\Program Files\On-premises data gateway,確認您具有寫入權限,並編輯下列檔案:Navigate to the gateway’s installation folder, C:\Program Files\On-premises data gateway as an administrator, to ensure that you have write-permissions, and edit the following file:

  4. 根據「您的」 AD 使用者的 Active Directory 屬性設定,編輯下列兩個設定值。Edit the following two configuration values according to your Active Directory attribute configurations of your AD users. 下面所示的設定值只是範例,而您必須根據 Active Directory 設定來指定它們。The configuration values shown below are just examples – you need to specify them based on your Active Directory configuration.

  5. 重新啟動內部部署資料閘道服務,以讓設定變更生效。Restart the on-premises data gateway service for the configuration change to take effect.

使用對應規則Working with mapping rules

若要建立對應規則,請輸入一個原始名稱新名稱,然後選取 [新增]。To create a mapping rule, enter a value for Original name and New Name and then select Add.

欄位Field 描述Description
取代 (原始名稱)Replace (Original name) 您登入 Power BI 的電子郵件地址。The email address that you signed into Power BI with.
使用 (新名稱)With (New Name) 您要用來取代的值。The value you want to replace it with. 取代結果將會傳送至 EffectiveUserName 屬性,以進行 Analysis Services 連接。The result of the replacement is what will be passed to the EffectiveUserName property for the Analysis Services connection.

當您在清單中選取項目時,您可以選擇使用 V 形箭號圖示刪除項目,以進行重新排序。When you select an item in the list, you can choose to re-order it by using the chevron icons, or Delete the entry.

使用萬用字元 (*)Using wildcard (*)

[Replace (Original name)] (取代 (原始名稱)) 字串可以使用萬用字元。You can use a wildcard for your Replace (Original name) string. 它只能用於本身,不能搭配任何其他字串部分。It can only be used on its own and not with any other string part. 這可讓您接受所有使用者,將單一值傳遞給資料來源。This will allow you to take all users and pass a single value to the data source. 當您希望組織中的所有使用者在本機環境中使用同一使用者時,這非常有用。This is useful when you want all users in your organization to use the same user in your local environment.

測試對應規則Test a mapping rule

您可以輸入原始名稱 值,然後選取測試規則,以驗證即將取代原始名稱的內容。You can validate what an original name will be replaced with by entering a value for Original name and selecting Test rule.


服務需要幾分鐘才能開始使用已儲存的規則。Rules that are saved will take a few minutes for the service to start using them. 規則在瀏覽器中會立即生效。Within the browser, the rule will work immediately.

對應規則的限制Limitations for mapping rules

  • 對應是針對是正在設定的特定資料來源所設計的功能。Mapping is for the specific data source that is being configured. 它不是全域設定。It is not a global settings. 如果您有多個 Analysis Services 資料來源,您將必須對應每個資料來源的使用者。If you have multiple Analysis Services data sources, you will have to map the users for each data source.

移除資料來源Remove a data source

移除資料來源的同時也會中斷依賴指定資料來源的所有儀表板或報表。Removing a data source will break any dashboards or reports that rely on the given data source.

若要移除資料來源,請前往 [資料來源] > [移除]。To remove a data source, go to Data Source > Remove.

管理管理員Manage administrators

在閘道的 [管理員] 索引標籤上,您可以新增並移除可管理閘道的使用者 (或安全性群組)。On the Administrators tab for the gateway, you can add and remove users (or security groups) that can administer the gateway.

管理使用者Manage users

您可以在 [使用者] 索引標籤上,為資料來源新增及移除可以使用這個資料來源的使用者或安全性群組。On the Users tab for the data source, you can add, and remove, users, or security groups, that can use this data source.


使用者清單僅控制獲准發行報表的人員。The users list only controls who are allowed to publish reports. 報表擁有者可以建立儀表板或內容套件,並與其他使用者共用。The report owners can create dashboards, or content packs, and share those with other users.

使用資料來源Using the data source

建立資料來源之後,您將可使用其中一個即時連線或透過已排程的重新整理,以取得資料來源。After you have created the data source, it will be available to use with either live connections, or through scheduled refresh.


伺服器和資料庫名稱必須符合內部部署資料閘道內的 Power BI Desktop 和資料來源!Server and database name have to match between Power BI Desktop and the data source within the on-premises data gateway!

您的資料集和閘道內的資料來源是根據您的伺服器名稱和資料庫名稱以建立連結。The link between your dataset and the data source within the gateway is based on your server name and database name. 這些項目必須相符。These have to match. 例如,若您的伺服器名稱是 IP 位址,在 Power BI Desktop 內,您將必須使用該 IP 位址以取得閘道設定內的資料來源。For example, if you supply an IP Address for the server name, within Power BI Desktop, you will need to use the IP Address for the data source within the gateway configuration. 若您使用 SERVER\INSTANCE,在 Power BI Desktop 中,您將必須使用相同的伺服器名稱以取得閘道內設定的資料來源。If you use SERVER\INSTANCE, in Power BI Desktop, you will need to use the same within the data source configured for the gateway.

這適用於即時連線和已排程的重新整理。This is the case for both live connections and scheduled refresh.

使用即時連線來使用資料來源Using the data source with live connections

您必須確定伺服器和資料庫名稱與 Power BI Desktop 及閘道已設定的資料來源相符。You will need to make sure the server and database name matches between Power BI Desktop and the configured data source for the gateway. 您也必須確定資料來源的 [使用者] 索引標籤已列出您的使用者,以便發行即時連線資料集。You will also need to make sure your user is listed in the Users tab of the data source in order to publish live connection datasets. 當您第一次匯入資料時,Power BI Desktop 內會出現即時連線的選取項目。The selection, for live connections, occurs within Power BI Desktop when you first import data.

發行之後,您的報表會從 Power BI Desktop 或取得資料開始工作。After you publish, either from Power BI Desktop or Get Data, your reports should start working. 建立閘道內的資料來源之後,可能需要幾分鐘的時間才能使用連線。It may take several minutes, after creating the data source within the gateway, for the connection to be usable.

使用已排程的重新整理使用資料來源Using the data source with scheduled refresh

若閘道內設定資料來源的 [使用者] 索引標籤中列出您的使用者,而伺服器和資料庫名稱也相符,您就可以將閘道作為進行已排程重新整理的一個選項。If you are listed in the Users tab of the data source configured within the gateway, and the server and database name match, you will see the gateway as an option to use with scheduled refresh.

後續步驟Next steps

內部部署資料閘道On-premises data gateway
內部部署資料閘道 - 深入資訊On-premises data gateway - in-depth
為內部部署資料閘道進行疑難排解Troubleshooting the on-premises data gateway
有其他問題嗎?More questions? 試試 Power BI 社群Try the Power BI Community