在 Power BI Desktop 中为移动应用设置地理筛选器Set geographic filters in Power BI Desktop for the mobile apps

在 Power BI Desktop 中,可以针对列进行地理数据分类,以便 Power BI Desktop 知道如何处理报表中可视化对象的值。In Power BI Desktop, you can categorize geographical data for a column, so Power BI Desktop knows how to treat values in visuals in a report. 还有一个好处就是,当你或你的同事在 Power BI 移动应用中查看相应的报表时,Power BI 会自动提供与你所在地理位置匹配的地理位置筛选器。As an added benefit, when you or your colleagues view that report in the Power BI mobile apps, Power BI automatically provides geographical filters that match where you are.

比如说,你是一名需要会见客户的销售经理,那么你会想要快速筛选出目标客户的销售总额和收入。For example, say you're a sales manager traveling to meet customers, and you'd like to quickly filter the total sales and revenue for the specific customer you're planning to visit. 你想要按省/自治区、城市或实际地址对当前位置的数据进行分类。You want to break out the data for your current location, whether by state, city, or an actual address. 之后,如果还有时间,你会想要去拜访附近的其他客户。Later, if you have time left, you'd like to visit other customers located nearby. 可以按你所在位置来筛选报表以查找这些客户You can filter the report by your location to find those customers.

备注

如果报表中的地理名称采用的是英语–例如,“New York City” 或 “Germany”,那么只可在移动应用中按位置筛选。You can only filter by location in the mobile app if the geographic names in the report are in English – for example, "New York City" or "Germany".

标识报表中的地理数据Identify geographic data in your report

  1. 在 Power BI Desktop 中切换到数据视图In Power BI Desktop, switch to Data View 数据视图图标.
  2. 选择含地理数据的列—,例如“城市”列。Select a column with geographic data — for example, a City column.

    “城市”列

  3. 在“建模”选项卡上,选择“数据类别”,那么本示例中的正确类别—为“城市”。On the Modeling tab, select Data Category, then the correct category — in this example, City.

    数据类别框

  4. 在模型中为其他任何字段继续设置地理数据类别。Continue setting geographic data categories for any other fields in the model.

    备注

    可以为模型中的每个数据类别设置多个列,但如果这样做,模型就无法在 Power BI 移动应用中筛选地理。You can set multiple columns for each data category in a model, but if you do the model can't filter for geography in the Power BI mobile app. 若要在移动应用中使用地理筛选,则为每个数据类别—仅设置一列,例如一个“城市”列、一个“省/自治区”列和一个“国家/地区”列。To use geographic filtering in the mobile apps, set only one column for each data category — for example, only one City column, one State or Province column, and one Country column.

使用地理数据创建视觉对象Create visuals with your geographic data

  1. 切换到报表视图 Switch to Report view 报表视图图标,然后创建使用数据中的地理字段的视觉对象。, and create visuals that use the geographic fields in your data.

    带有地图的报表

    在此示例中,该模型还包含计算列,该列将城市和州放在同一列。In this example, the model also contains a calculated column that brings city and state together in one column. 阅读在 Power BI Desktop 中创建计算列Read about creating calculated columns in Power BI Desktop.

    城市 + 状态字段

  2. 将报表发布到 Power BI 服务。Publish the report to the Power BI service.

在 Power BI 移动应用中查看报表View the report in Power BI mobile app

  1. 在任意 Power BI 移动应用中打开报表。Open the report in any of the Power BI mobile apps.
  2. 如果你位于报表中数据相关的地理位置,则可以自动筛选到该位置。If you're in a geographic location with data in the report, you can filter it automatically to your location.

    移动应用中的地区筛选器

详细了解如何在 Power BI 移动应用中按地理位置筛选报表Read more about filtering a report by location in the Power BI mobile apps.

后续步骤Next steps