{"id":16473,"date":"2024-06-18T09:56:11","date_gmt":"2024-06-18T02:56:11","guid":{"rendered":"https:\/\/fpt-is.com\/en\/?post_type=goc_nhin_so&#038;p=16473"},"modified":"2024-07-26T09:35:30","modified_gmt":"2024-07-26T02:35:30","slug":"uses-of-shape-maps-in-power-bi","status":"publish","type":"goc_nhin_so","link":"https:\/\/fpt-is.com\/en\/insights\/uses-of-shape-maps-in-power-bi\/","title":{"rendered":"Uses of Shape Maps in Power BI"},"content":{"rendered":"<p><b>The Shape Maps feature in Power BI is not only a charting tool but also an effective method for displaying regional data insights. With the ability to create rich and powerful geographic charts, Shape Maps <\/b><b>adds<\/b><b> a new feature to data visualization and analysis in Power BI.<\/b><\/p>\n<h2><b>1. Uses of Shape Maps in Power BI<\/b><\/h2>\n<p><span style=\"font-weight: 400\">In creating reports using data visualization tools, illustrating data using maps has become a routine task, particularly for comparing data between regions. The simplest way to accomplish such tasks is to use <\/span><b>Shape Maps<\/b><span style=\"font-weight: 400\">. Unlike commonly used <\/span><b>Maps<\/b><span style=\"font-weight: 400\">, a <\/span><b>Shape Map <\/b><span style=\"font-weight: 400\">cannot display the exact geographic locations of data points on the map. Instead, its main purpose is to compare regions on a map by coloring them differently.\u00a0<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-19325 aligncenter\" src=\"https:\/\/cdn.fpt-is.com\/vi\/M-1-1715244788.png\" alt=\"M 1 1715244788\" width=\"512\" height=\"273\" \/><\/p>\n<p style=\"text-align: center\"><span style=\"font-size: 10pt\"><i><span style=\"font-weight: 400\">Figure 1 \u2013 Current status of land use in each region and province of Vietnam<\/span><\/i><\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-19324 aligncenter\" src=\"https:\/\/cdn.fpt-is.com\/vi\/M-2-1715244785.png\" alt=\"M 2 1715244785\" width=\"512\" height=\"281\" \/><\/p>\n<p style=\"text-align: center\"><span style=\"font-size: 10pt\"><i><span style=\"font-weight: 400\">Figure 2 &#8211; Land statistics of districts in Da Nang<\/span><\/i><\/span><\/p>\n<p><span style=\"font-weight: 400\">When moving the mouse over an area or selecting an area, the displayed descriptions, as well as other display areas of the report, also change corresponding to the selected object.<\/span><\/p>\n<p><span style=\"font-weight: 400\">This article shares the author&#8217;s knowledge of using <\/span><b>Shape Maps <\/b><span style=\"font-weight: 400\">in <\/span><b>Power BI<\/b><span style=\"font-weight: 400\">, searching for Vietnam&#8217;s national administrative map, as well as adjusting the content, scope, and quality of the map.<\/span><\/p>\n<h2><strong>2. Using Shape Map in Power BI<\/strong><\/h2>\n<p><b>Shape Maps<\/b><span style=\"font-weight: 400\"> are not available by default in <\/span><b>Power BI Desktop<\/b><span style=\"font-weight: 400\">. You need to enable the feature by selecting <\/span><b>File &gt; Options and Settings &gt; Options &gt; Preview Features<\/b><span style=\"font-weight: 400\"> and selecting the <\/span><b>Shape map visual <\/b><span style=\"font-weight: 400\">checkbox as shown below (The order of options may vary depending on your <\/span><b>Power BI Desktop<\/b><span style=\"font-weight: 400\"> version).<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-19323 aligncenter\" src=\"https:\/\/cdn.fpt-is.com\/vi\/M-3-1715244782.png\" alt=\"M 3 1715244782\" width=\"504\" height=\"512\" \/><\/p>\n<p><span style=\"font-weight: 400\">After restarting Power BI Desktop, select the <\/span><b>Shape Map <\/b><span style=\"font-weight: 400\">icon in the <\/span><b>Visualizations <\/b><span style=\"font-weight: 400\">pane as shown below.<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-19322 aligncenter\" src=\"https:\/\/cdn.fpt-is.com\/vi\/M-4-1715244769.png\" alt=\"M 4 1715244769\" width=\"186\" height=\"310\" \/><\/p>\n<p><b>Power BI Desktop<\/b><span style=\"font-weight: 400\"> will create an empty <\/span><b>Shape Map<\/b><span style=\"font-weight: 400\">.<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-19321 aligncenter\" src=\"https:\/\/cdn.fpt-is.com\/vi\/M-5-1715244766.png\" alt=\"M 5 1715244766\" width=\"424\" height=\"512\" \/><\/p>\n<p><span style=\"font-weight: 400\">Prepare some data tables in advance to create a report. Normally, for easy viewing, we should use no more than 2 levels of administrative units in a report. For example, prepare data for regions &#8211; provinces\/cities (centrally run cities), or data for districts in a city, or data for wards\/communes in a district. A map with too many objects such as the following image would be difficult to understand.<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-19320 aligncenter\" src=\"https:\/\/cdn.fpt-is.com\/vi\/M-6-1715244763.png\" alt=\"M 6 1715244763\" width=\"297\" height=\"512\" \/><\/p>\n<p><span style=\"font-weight: 400\">After adding a <\/span><b>Shape Map<\/b><span style=\"font-weight: 400\"> to your report, add the administrative division data from the previously prepared data table to the <\/span><b>Location <\/b><span style=\"font-weight: 400\">and <\/span><b>Color saturation<\/b><span style=\"font-weight: 400\"> boxes. Once completed, select the <\/span><b>Format for visual<\/b><span style=\"font-weight: 400\"> tab (paint brush icon) in the <\/span><b>Visualizations <\/b><span style=\"font-weight: 400\">pane, expand the <\/span><b>Map settings<\/b><span style=\"font-weight: 400\"> section, select <\/span><b>Custom map<\/b><span style=\"font-weight: 400\"> for <\/span><b>Map type, <\/b><span style=\"font-weight: 400\">and select <\/span><b>+ Add a map type<\/b><span style=\"font-weight: 400\">.<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-19319 aligncenter\" src=\"https:\/\/cdn.fpt-is.com\/vi\/M-7-1715244761.png\" alt=\"M 7 1715244761\" width=\"184\" height=\"456\" \/><\/p>\n<p><span style=\"font-weight: 400\">You can then click View map type key to see the names of data columns used to display the details of administrative divisions.<\/span><\/p>\n<p><img decoding=\"async\" class=\"size-full wp-image-19318 aligncenter\" src=\"https:\/\/cdn.fpt-is.com\/vi\/M-8-1715244758.png\" alt=\"M 8 1715244758\" width=\"512\" height=\"180\" \/><\/p>\n<p><span style=\"font-weight: 400\">If you use the original map downloaded from <\/span><a href=\"https:\/\/gadm.org\/download_country.html\" rel=\"nofollow noopener\" target=\"_blank\"><span style=\"font-weight: 400\">https:\/\/gadm.org\/download_country.html<\/span><\/a><span style=\"font-weight: 400\">, the naming convention is as follows: use Vietnamese place name with accent marks for NAME, Vietnamese place name without accent marks for VARNAME, _0 for national level, _1 for province\/centrally run city level, _2 for urban district\/district level, and _3 for commune level. The administrative division columns in your reporting data table should be prepared according to this convention to ensure accurate display on the report. The data on <\/span><b>Map keys<\/b><span style=\"font-weight: 400\"> above were used for the example in Figure 2 at the beginning of this article. <\/span><b>Custom map <\/b><span style=\"font-weight: 400\">of <\/span><b>Shape Map <\/b><span style=\"font-weight: 400\">can be used when maps are in <\/span><b>TopoJSON <\/b><span style=\"font-weight: 400\">format. In case your map is in a different format, you can use online tools such as <\/span><b>Map Shaper <\/b><span style=\"font-weight: 400\">to convert it to <\/span><b>TopoJSON <\/b><span style=\"font-weight: 400\">format.\u00a0<\/span><\/p>\n<h2><strong>3. Search for available Vietnam maps<\/strong><\/h2>\n<p><span style=\"font-weight: 400\">The author&#8217;s usual source for maps is <\/span><a href=\"https:\/\/gadm.org\/download_country.html\" rel=\"nofollow noopener\" target=\"_blank\"><span style=\"font-weight: 400\">https:\/\/gadm.org\/download_country.html<\/span><\/a><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-19317 aligncenter\" src=\"https:\/\/cdn.fpt-is.com\/vi\/M-9-1715244754.png\" alt=\"M 9 1715244754\" width=\"512\" height=\"308\" \/><\/p>\n<p><span style=\"font-weight: 400\">Vietnam maps from GADM offer all shape map data of national, provincial, district, and commune levels. However, Hoang Sa and Truong Sa are not included in the main map of Vietnam. Although displaying these two archipelagos has little meaning to a report, if you need them to be displayed for other reasons, you can search and download their maps using the keywords Paracel Islands (Hoang Sa) and Spratly Islands (Truong Sa). After downloading, we will have 3 files as follows:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">gadm36_VNM_shp.zip (Vietnam administrative map)<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">gadm36_XPI_shp.zip (Hoang Sa map)<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">gadm36_XSP_shp.zip (Truong Sa map)<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400\">You can also obtain maps from <\/span><a href=\"https:\/\/data.opendevelopmentmekong.net\/dataset\/a-phn-tnh?trk=article-ssr-frontend-pulse_little-text-block\" rel=\"nofollow noopener\" target=\"_blank\"><span style=\"font-weight: 400\">https:\/\/data.opendevelopmentmekong.net\/dataset\/a-phn-tnh?trk=article-ssr-frontend-pulse_little-text-block<\/span><\/a><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-19316 aligncenter\" src=\"https:\/\/cdn.fpt-is.com\/vi\/M-10-1715244749.png\" alt=\"M 10 1715244749\" width=\"512\" height=\"361\" \/><\/p>\n<p><span style=\"font-weight: 400\">The map on this page only shows provincial administrative divisions. However, it includes Hoang Sa and Truong Sa archipelagos (adjusted for better visibility though not accurate in terms of scale).<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-19315 aligncenter\" src=\"https:\/\/cdn.fpt-is.com\/vi\/M-11-1715244746.png\" alt=\"M 11 1715244746\" width=\"512\" height=\"285\" \/><\/p>\n<p><span style=\"font-weight: 400\">Depending on your purposes, you can use one of the two map sources above or find other sources.<\/span><\/p>\n<h2><strong>4. Use <a href=\"https:\/\/mapshaper.org\/\" rel=\"nofollow noopener\" target=\"_blank\">Map Shaper<\/a>\u00a0to filter and select maps<\/strong><\/h2>\n<p><span style=\"font-weight: 400\">Open the web application, drag and drop the map downloaded from the previous step to the application screen.<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-19314 aligncenter\" src=\"https:\/\/cdn.fpt-is.com\/vi\/M-12-1715244743.png\" alt=\"M 12 1715244743\" width=\"512\" height=\"273\" \/><\/p>\n<p><span style=\"font-weight: 400\">Mapshaper can work with the following data types: Shapefile, GeoJSON, TopoJSON, KLM, and CVS. Here, a shapefile file downloaded from GADM version 4.1 is used. (You can also drag and drop files in the extracted folder, or even drag and drop a whole zip file, into the Mapshaper application screen.)<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-19326 aligncenter\" src=\"https:\/\/cdn.fpt-is.com\/vi\/hu-1715245129.png\" alt=\"Hu 1715245129\" width=\"512\" height=\"326\" \/><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-19313 aligncenter\" src=\"https:\/\/cdn.fpt-is.com\/vi\/M-13-1715244740.png\" alt=\"M 13' 1715244740\" width=\"512\" height=\"409\" \/><\/p>\n<p><b>Basemap<\/b><span style=\"font-weight: 400\"> can be used to display map background images or satellite images. The <\/span><b>Layers <\/b><span style=\"font-weight: 400\">dialog box in the image below indicates that the second layer (including 710 polygons) is being displayed.<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-19312 aligncenter\" src=\"https:\/\/cdn.fpt-is.com\/vi\/M-14-1715244737.png\" alt=\"M 14 1715244737\" width=\"278\" height=\"387\" \/><\/p>\n<p><span style=\"font-weight: 400\">The image above also clearly shows that layer 0 includes 1 polygon which is the map of the entire country of Vietnam, layer 1 includes 63 polygons corresponding to 63 provinces\/cities, layer 2 includes 710 polygons corresponding to 710 urban districts\/districts, and layer 3 includes 11,163 polygons corresponding to the number of administrative divisions of ward\/commune level.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">If you need a map of 63 provinces, simply Export layer 1 to <\/span><b>TopoJSON<\/b><span style=\"font-weight: 400\">. Click the <\/span><b>Export <\/b><span style=\"font-weight: 400\">button in the upper right corner of the application screen, and set some options. Your desired map will be exported.<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-19311 aligncenter\" src=\"https:\/\/cdn.fpt-is.com\/vi\/M-15-1715244734.png\" alt=\"M 15 1715244734\" width=\"499\" height=\"512\" \/><\/p>\n<p><span style=\"font-weight: 400\">If you need to select a range, such as districts in Da Nang city, perform the following steps:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Open the <\/span><b>Layers <\/b><span style=\"font-weight: 400\">dialog box. On the dialog, click\u00a0 on the eye icons to the right of the layers. Single click the icon to turn the layer&#8217;s display status on\/off and double click it to select the layer as the working layer so that your dialog is as shown below. There are 3 following states of the eye icon, the black icon indicating the working layer (you can view details, keep or delete objects of the layer), the blue ones indicating the displayed layers (view only), and the blurred ones indicating hidden layers. The goal of this step is to work with layer 2.<\/span><\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-19310 aligncenter\" src=\"https:\/\/cdn.fpt-is.com\/vi\/M-16-1715244731.png\" alt=\"M 16 1715244731\" width=\"279\" height=\"388\" \/><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Drag and zoom the map to the Da Nang area, press the arrow icon on the right side of the application screen and select <\/span><b>inspect features <\/b><span style=\"font-weight: 400\">(with a small triangle to the right). When you hover over an object (urban district\/district), detailed information will be displayed in the upper left corner of the screen.<\/span><\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-19309 aligncenter\" src=\"https:\/\/cdn.fpt-is.com\/vi\/M-17-1715244727.png\" alt=\"M 17 1715244727\" width=\"512\" height=\"349\" \/><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">When you select <\/span><b>selection tool <\/b><span style=\"font-weight: 400\">(with a small triangle to the right), the detailed description of the object is displayed similarly when selecting <\/span><b>inspect features<\/b><span style=\"font-weight: 400\">.\u00a0<\/span><\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-19308 aligncenter\" src=\"https:\/\/cdn.fpt-is.com\/vi\/M-18-1715244725.png\" alt=\"M 18 1715244725\" width=\"205\" height=\"222\" \/><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Click to select each object (urban districts and districts) in Da Nang and then click the <\/span><b>Keep <\/b><span style=\"font-weight: 400\">button.<\/span><\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-19307 aligncenter\" src=\"https:\/\/cdn.fpt-is.com\/vi\/M-19-1715244722.png\" alt=\"M 19 1715244722\" width=\"512\" height=\"283\" \/><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">All objects in layer 2 will be deleted except for the ones you have selected. Repeat the <\/span><b>Export <\/b><span style=\"font-weight: 400\">step for layer 2, you will now have a TopoJSON file of districts of Da Nang.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">Use <\/span><b>Delete <\/b><span style=\"font-weight: 400\">command to delete the currently selected objects. Use <\/span><b>Duplicate <\/b><span style=\"font-weight: 400\">command to copy selected objects to a new layer (working layer). Use <\/span><b>Split <\/b><span style=\"font-weight: 400\">command to cut selected objects to a new layer (working layer). Use <\/span><b>Bounds <\/b><span style=\"font-weight: 400\">command to display the coordinates for the boundary area of the selected object group. Use <\/span><b>Edit data <\/b><span style=\"font-weight: 400\">command to edit detailed information of objects (in the dialog box at the top left of the application screen). Use <\/span><b>Clear <\/b><span style=\"font-weight: 400\">command to close the working menu for the selected objects.<\/span><\/p>\n<p><span style=\"font-weight: 400\">After selecting the layer (working layer), you can also select <\/span><b>Simplify <\/b><span style=\"font-weight: 400\">to adjust the level of map detail (by sliding the slider). This command will remove some corner points of the displayed polygons, making the image smoother (similar to <\/span><b>Zoom Out<\/b><span style=\"font-weight: 400\">). Sometimes this function might cause some small islands to be invisible. The more you simplify the map, the smaller the TopoJSON file will be. Depending on your purpose, you should try different detail level of the map to simplify your map and reduce the file size. (In some cases, you may hardly notice any difference even when reducing the map detail level by 50%.)\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">In conclusion, this overview highlights the author&#8217;s practical insights and the benefits of using <\/span><b>Shape Maps<\/b><span style=\"font-weight: 400\"> for <\/span><b>Power BI Desktop<\/b><span style=\"font-weight: 400\">. <\/span><b>Shape Maps<\/b><span style=\"font-weight: 400\"> enhance the clarity and user-friendliness of reports when comparing statistical analysis data across regions. If you want to use shape maps for objects other than administrative divisions, you can use map editor software to draw and export a map to TopoJSON format.<\/span><\/p>\n<table style=\"border-collapse: collapse;width: 100%\">\n<tbody>\n<tr>\n<td style=\"width: 100%\"><strong>Exclusive article by FPT IS Expert<\/strong><\/p>\n<p><em>Author Pham Quang Son \u2013 Consulting expert, Government sector, FPT IS<\/em><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"author":3,"featured_media":16474,"parent":0,"template":"","nang_luc":[828,790],"danh_muc_goc_nhin_so":[528,789],"dich_vu":[858,859],"linh_vuc":[856,519],"platform":[],"san_pham":[],"the_goc_nhin_so":[],"class_list":["post-16473","goc_nhin_so","type-goc_nhin_so","status-publish","has-post-thumbnail","hentry","nang_luc-digital-transformation","nang_luc-experts-sharing","danh_muc_goc_nhin_so-digital-transformation","danh_muc_goc_nhin_so-expert-sharing","dich_vu-private-sector-news","dich_vu-public-sector-news","linh_vuc-enterprises","linh_vuc-government"],"acf":[],"_links":{"self":[{"href":"https:\/\/fpt-is.com\/en\/wp-json\/wp\/v2\/goc_nhin_so\/16473","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fpt-is.com\/en\/wp-json\/wp\/v2\/goc_nhin_so"}],"about":[{"href":"https:\/\/fpt-is.com\/en\/wp-json\/wp\/v2\/types\/goc_nhin_so"}],"author":[{"embeddable":true,"href":"https:\/\/fpt-is.com\/en\/wp-json\/wp\/v2\/users\/3"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fpt-is.com\/en\/wp-json\/wp\/v2\/media\/16474"}],"wp:attachment":[{"href":"https:\/\/fpt-is.com\/en\/wp-json\/wp\/v2\/media?parent=16473"}],"wp:term":[{"taxonomy":"nang_luc","embeddable":true,"href":"https:\/\/fpt-is.com\/en\/wp-json\/wp\/v2\/nang_luc?post=16473"},{"taxonomy":"danh_muc_goc_nhin_so","embeddable":true,"href":"https:\/\/fpt-is.com\/en\/wp-json\/wp\/v2\/danh_muc_goc_nhin_so?post=16473"},{"taxonomy":"dich_vu","embeddable":true,"href":"https:\/\/fpt-is.com\/en\/wp-json\/wp\/v2\/dich_vu?post=16473"},{"taxonomy":"linh_vuc","embeddable":true,"href":"https:\/\/fpt-is.com\/en\/wp-json\/wp\/v2\/linh_vuc?post=16473"},{"taxonomy":"platform","embeddable":true,"href":"https:\/\/fpt-is.com\/en\/wp-json\/wp\/v2\/platform?post=16473"},{"taxonomy":"san_pham","embeddable":true,"href":"https:\/\/fpt-is.com\/en\/wp-json\/wp\/v2\/san_pham?post=16473"},{"taxonomy":"the_goc_nhin_so","embeddable":true,"href":"https:\/\/fpt-is.com\/en\/wp-json\/wp\/v2\/the_goc_nhin_so?post=16473"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}