教程:使用 Power BI Desktop 进行连接Tutorial: Connect with Power BI Desktop

在本教程中,你使用 Power BI Desktop 连接到服务器上的 adventureworks 示例模型数据库。In this tutorial, you use Power BI Desktop to connect to the adventureworks sample model database on your server. 你完成的任务将模拟到模型的典型用户连接和基于模型数据创建基本报表。The tasks you complete simulate a typical user connection to the model and creating a basic report from model data.

  • 从门户获取服务器名称Get your server name from the portal
  • 使用 Power BI Desktop 进行连接Connect by using Power BI Desktop
  • 创建基本报表Create a basic report

必备条件Prerequisites

登录到 Azure 门户Sign in to the Azure portal

在本教程中,登录到门户只是为了获取服务器名称。In this tutorial, you sing in to the portal to get the server name only. 通常,用户将从服务器管理员那里获取服务器名称。Typically, users would get the server name from the server administrator.

登录门户Sign in to the portal.

获取服务器名称Get server name

若要从 Power BI Desktop 连接到服务器,首先需要服务器名称。In order to connect to your server from Power BI Desktop, you first need the server name. 可以从门户获取服务器名称。You can get the server name from the portal.

Azure 门户中,单击“服务器”>“概述” > “服务器名称” ,并复制服务器名称。In Azure portal > server > Overview > Server name, copy the server name.

在 Azure 中获取服务器名称

在 Power BI Desktop 中连接Connect in Power BI Desktop

  1. 在 Power BI Desktop 中,单击“获取数据” > “Azure” > “Azure Analysis Services 数据库” 。In Power BI Desktop, click Get Data > Azure > Azure Analysis Services database.

    在“获取数据”中连接

  2. 在“服务器” 中,粘贴服务器名称,然后在“数据库” 中输入 adventureworks,然后单击“确定”。 In Server, paste the server name, then in Database, enter adventureworks, and then click OK.

    指定服务器名称和模型数据库

  3. 在系统提示时输入凭据。When prompted, enter your credentials. 你输入的帐户必须至少具有 adventureworks 示例模型数据库的读取权限。The account you enter must have at least read permissions for the adventureworks sample model database.

    adventureworks 模型将在 Power BI Desktop 中打开,并且“报表”视图中将显示一个空白报表。The adventureworks model opens in Power BI Desktop with a blank report in Report view. “字段”列表中会显示所有非隐藏的模型对象。 The Fields list displays all non-hidden model objects. 连接状态显示在右下角。Connection status is displayed in the lower-right corner.

  4. 在“可视化效果” 中,选择“簇状条形图” ,单击“格式” (滚漆筒图标),然后启用“数据标签”。 In VISUALIZATIONS, select Clustered Bar Chart, then click Format (paint roller icon), and then turn on Data labels.

    可视化效果

  5. 在“字段” > Internet Sales 表中,选择 Internet Sales TotalMargin 度量值。In FIELDS > Internet Sales table, select Internet Sales Total and Margin measures. Product Category 表中,选择 Product Category NameIn Product Category table, select Product Category Name.

    完成报表

    花费几分钟时间来探究 adventureworks 示例模型:创建不同的可视化效果并对数据和指标进行切片。Take a few minutes to explore the adventureworks sample model by creating different visualizations and slicing on data and metrics. 当对报表感到满意后,务必进行保存。When you're happy with your report, be sure to save.

清理资源Clean up resources

如果不再需要报表,则不要保存它,如果已保存,则将文件删除。If no longer needed, do not save your report or delete the file if you did save.

后续步骤Next steps

在本教程中,你已了解了如何使用 Power BI Desktop 连接到服务器上的数据模型并创建基本报表。In this tutorial, you learned how to use Power BI Desktop to connect to a data model on a server and create a basic report. 如果不熟悉如何创建数据模型,请参阅 SQL Server Analysis Services 文档中的 Adventure Works Internet Sales 表格数据建模教程If you're not familiar with how to create a data model, see the Adventure Works Internet Sales tabular data modeling tutorial in the SQL Server Analysis Services docs.