Power BI 中的區域分布圖 (分級著色圖) (教學課程)Filled maps (choropleths) in Power BI (Tutorial)

區域分布圖使用陰影、濃淡或圖樣,顯示值的比例如何隨著地理位置或地區而有所不同。A filled map uses shading or tinting or patterns to display how a value differs in proportion across a geography or region. 可使用範圍介於淺色 (較不常見/較低) 到深色 (較常見/較多) 的陰影,快速顯示這些相對差異。Quickly display these relative differences with shading that ranges from light (less-frequent/lower) to dark (more-frequent/more).

傳送至 Bing 的項目What is sent to Bing

Power BI 與 Bing 整合以提供預設地圖座標 (這個程序稱為地理編碼)。Power BI integrates with Bing to provide default map coordinates (a process called geo-coding). 當您在 Power BI 服務或 Power BI Desktop 中建立地圖視覺效果時,[位置]、[緯度] 和 [經度] 貯體中的資料 (用來建立該視覺效果) 會傳送至 Bing。When you create a map visualization in Power BI service or Power BI Desktop, the data in the Location, Latitude, and Longitude buckets (that is being used to create that visualization) is sent to Bing.

您或您的系統管理員可能需要更新防火牆,以允許存取 Bing 用以進行地理編碼的 URL。You, or your administrator, may need to update your firewall to allow access to the URLs Bing uses for geocoding. 這些 URL 是:Those URLs are:

如需有關傳送至 Bing 之資料的詳細資訊,以及提升地理編碼成功率的祕訣,請參閱地圖視覺效果的祕訣和訣竅For more information about the data being sent to Bing, and for tips to increase your geo-coding success, see Tips and tricks for map visualizations.

使用區域分布圖的時機When to use a filled map

區域分布圖極適合:Filled maps are a great choice:

  • 當您要在地圖上顯示量化資訊。to display quantitative information on a map.
  • 當您要顯示空間模式和關聯性。to show spatial patterns and relationships.
  • 當您的資料已標準化。when your data is standardized.
  • 當您使用的是社會經濟資料。when working with socioeconomic data.
  • 當定義的區域相當重要。when defined regions are important.
  • 當您要取得跨地理位置的分佈概觀。to get an overview of the distribution across the geographic locations.

先決條件Prerequisites

  • Power BI 服務或 Power BI DesktopPower BI service or Power BI Desktop
  • 銷售與行銷範例Sales and Marketing Sample

若要跟著做,請留意到本教學課程使用的是 Power BI 服務,而非 Power BI Desktop。To follow along, the tutorial uses Power BI service, not Power BI Desktop.

建立基本的區域分布圖Create a basic filled map

在這段影片中,Kim 會建立一個基本地圖,並將其轉換成區域分布圖。In this video, Kim creates a basic map and converts it to a filled map.

  1. 若要建立您自己的區域分布圖,請下載銷售與行銷範例,方法是登入 Power BI,然後選取 [取得資料] > [範例] > [銷售與行銷] > [連線]。To create your own filled map, download the Sales and Marketing sample by signing in to Power BI and selecting Get Data > Samples > Sales and Marketing > Connect.
  2. 出現成功訊息時,請選取 [檢視資料集]。When the success message appears, select View dataset.

  3. Power BI 會在編輯檢視中開啟空白報表畫布。Power BI opens a blank report canvas in Editing View.

  4. 從 [欄位] 窗格中,選取 [地理] > [州] 欄位。From the Fields pane, select the Geo > State field.

  5. 將圖表轉換成區域分布圖。Convert the chart to a filled map. 請注意,[州] 現在處於 [位置] 部分。Notice that State is now in the Location well. Bing 地圖服務會使用 [位置] 部分中的欄位來建立地圖。Bing Maps uses the field in the Location well to create the map. 此位置可以是各種不同的有效位置:國家/地區、州、縣市、城市、郵遞區號或其他郵遞區號等。Bing 地圖服務提供世界各地位置的區域分布圖。The location can be a variety of valid locations: countries, states, counties, cities, zip codes or other postal codes etc. Bing Maps provides filled map shapes for locations around the world. 如果 [位置] 部分沒有有效項目,Power BI 就不能建立區域分布圖。Without a valid entry in the Location well, Power BI cannot create the filled map.

  6. 篩選地圖,只顯示美國本土。Filter the map to display only the continental United States.

    a.a. 在 [視覺效果] 窗格底部尋找 [篩選] 區域。At the bottom of the Visualizations pane, look for the Filters area.

    b.b. 將滑鼠指標暫留在 [州],然後按一下展開V形箭號Hover over State and click the expand chevron

    c.c. 在 [全部] 旁邊放置一個核取記號,然後移除 [AK] 旁邊的核取記號。Place a checkmark next to All and remove the checkmark next to AK.

  7. 選取 [SalesFact] >[人氣],將其新增到 [色彩飽和度] 部分。Select SalesFact > Sentiment to add it to the Color saturation well. [色彩飽和度] 部分的欄位會控制地圖的明暗。The field in the Color saturation well controls the map shading.
  8. 區域分布圖會呈綠色,且淺綠色代表人氣指數較低,而深綠色代表人氣較高、較為正向。The filled map is shaded in green, with light green representing the lower sentiment numbers and dark green representing the higher, more-positive sentiment. 我們在此將懷俄明州 (WY) 反白顯示,發現人氣相當高,達 74。Here I've highlighted the state of Wyoming (WY) and see that Sentiment is very good, 74.
  9. 儲存報表Save the report.

反白顯示和交叉篩選Highlighting and cross-filtering

如需使用 [篩選] 窗格的資訊,請參閱將篩選新增至報表For information about using the Filters pane, see Add a filter to a report.

在區域分布圖中將位置反白,會交叉篩選報表頁面上的其他視覺效果,反之亦然。Highlighting a Location in a Filled Map cross-filters the other visualizations on the report page... and vice versa.

若要跟著做,請將區域分布圖複製並貼上到 [銷售與行銷] 報表的 [人氣] 分頁。To follow along, copy and paste your Filled map onto the Sentiment page of the Sales and Marketing report.

  1. 在區域分布圖中選取一個州。On the filled map, select a state. 這會反白顯示頁面上的其他視覺效果。This highlights the other visualizations on the page. 例如選取 [德州],會顯示人氣為 74,德州位於中央區 #23,而大部分的銷售量來自 [合適性] 與 [便利性] 區段。Selecting Texas, for example, shows me that Sentiment is 74, Texas is in the Central District #23, and that most of the sales volume comes from the Moderation and Convenience segments.
  2. 在折線圖上,於 [否] 和 [是] 之間切換。On the line chart, toggle between No and Yes. 這樣會篩選區域分布圖,來顯示 VanArsdel 和 VanArsdel 比較的人氣。This filters the Filled Map to show Sentiment for VanArsdel and for VanArsdel's competition.

考量與疑難排解Considerations and troubleshooting

地圖資料可能模稜兩可。Map data can be ambiguous. 例如,有在法國的巴黎,但也有「德州,巴黎」(Paris, Texas)。For example, there's a Paris, France, but there's also a Paris, Texas. 您的地理資料可能會儲存在個別資料行 (縣市名稱的資料行、州或省名稱的資料行等等),所以 Bing 可能無法判斷這裡的巴黎是哪個巴黎。Your geographic data is probably stored in separate columns – a column for city names, a column for state or province names, etc. – so Bing may not be able to tell which Paris is which. 如果您的資料集已經包含經度和緯度資料,Power BI 有特殊欄位可協助避免地圖資料模稜兩可。If your dataset already contains latitude and longitude data, Power BI has special fields to help make the map data unambiguous. 直接將包含緯度資料的欄位拖曳到 [視覺效果] > [緯度] 區域。Just drag the field that contains your latitude data into the Visualizations > Latitude area. 然後對經度資料執行相同的動作。And do the same for your longitude data.

如果您有權限可編輯 Power BI Desktop 中的資料集,請觀賞這段影片,以協助解決地圖模稜兩可的情況。If you have permissions to edit the dataset in Power BI Desktop, watch this video for help addressing map ambiguity.

如果您沒有經度和緯度資料的存取權,請遵循這些指示來更新您的資料集If you do not have access to latitude and longitude data, follow these instructions to update your dataset.

如需地圖視覺效果的更多說明,請參閱地圖視覺效果的祕訣和訣竅For more help with Map visualizations, see Tips and tricks for map visualizations.

後續步驟Next steps

將區域分布圖新增為儀表板磚 (釘選視覺效果) Add the filled map as a dashboard tile (pin the visual)
將視覺效果新增至報表Add a visualization to a report
Power BI 中的視覺效果類型 Visualization types in Power BI
變更所使用的視覺效果類型 Change the type of visualization being used
有其他問題嗎?More questions? 試試 Power BI 社群Try the Power BI Community