{"id":80470,"date":"2018-08-21T13:52:16","date_gmt":"2018-08-21T13:52:16","guid":{"rendered":"https:\/\/www.red-gate.com\/simple-talk\/?p=80470"},"modified":"2022-04-24T20:38:37","modified_gmt":"2022-04-24T20:38:37","slug":"power-bi-introduction-building-reports-in-power-bi-desktop-part-7","status":"publish","type":"post","link":"https:\/\/www.red-gate.com\/simple-talk\/databases\/sql-server\/bi-sql-server\/power-bi-introduction-building-reports-in-power-bi-desktop-part-7\/","title":{"rendered":"Power BI Introduction: Building Reports in Power BI Desktop \u2014 Part 7"},"content":{"rendered":"<p><strong>The series so far:<\/strong><\/p>\n<ol>\n<li><a href=\"https:\/\/www.red-gate.com\/simple-talk\/sql\/bi\/power-bi-part-1-introduction\/\">Power BI Introduction: Tour of Power BI \u2014 Part 1<\/a><\/li>\n<li><a href=\"https:\/\/www.red-gate.com\/simple-talk\/sql\/bi\/power-bi-introduction-working-with-power-bi-desktop-part-2\/\">Power BI Introduction: Working with Power BI Desktop \u2014 Part 2<\/a><\/li>\n<li><a href=\"https:\/\/www.red-gate.com\/simple-talk\/sql\/bi\/power-bi-introduction-working-with-r-scripts-in-power-bi-desktop-part-3\/\">Power BI Introduction: Working with R Scripts in Power BI Desktop \u2014 Part 3<\/a><\/li>\n<li><a href=\"https:\/\/www.red-gate.com\/simple-talk\/sql\/bi\/power-bi-introduction-working-with-parameters-in-power-bi-desktop-part-4\/\">Power BI Introduction: Working with Parameters in Power BI Desktop \u2014 Part 4<\/a><\/li>\n<li><a href=\"https:\/\/www.red-gate.com\/simple-talk\/sql\/bi\/power-bi-introduction-working-with-sql-server-data-in-power-bi-desktop-part-5\/\">Power BI Introduction:\u00a0Working with SQL Server data in Power BI Desktop \u2014 Part 5<\/a><\/li>\n<li><a href=\"https:\/\/www.red-gate.com\/simple-talk\/homepage\/power-bi-introduction-power-query-m-formula-language-in-power-bi-desktop-part-6\/\">Power BI Introduction:\u00a0Power Query M Formula Language in Power BI Desktop \u2014 Part 6<\/a><\/li>\n<li><a href=\"https:\/\/www.red-gate.com\/simple-talk\/sql\/bi\/power-bi-introduction-building-reports-in-power-bi-desktop-part-7\/\">Power BI Introduction: Building Reports in Power BI Desktop \u2014 Part 7<\/a><\/li>\n<li><a href=\"https:\/\/www.red-gate.com\/simple-talk\/sql\/bi\/power-bi-introduction-publishing-reports-to-the-power-bi-service-part-8\/\">Power BI Introduction: Publishing Reports to the Power BI Service \u2014 Part 8<\/a><\/li>\n<li><a href=\"https:\/\/www.red-gate.com\/simple-talk\/sql\/bi\/power-bi-introduction-visualizing-sql-server-audit-data-part-9\/\">Power BI Introduction: Visualizing SQL Server Audit Data \u2014 Part 9<\/a><\/li>\n<\/ol>\n\n<p>Until now, this series has focused primarily on building datasets in Power BI Desktop, with the understanding that the data would ultimately be used to create visualizations that provide insights into the underlying information. The visualizations would be included in one or more reports that could then be published to the Power BI service for wider distribution.<\/p>\n<p>This article switches focus from building datasets to creating reports that rely on those datasets, using the tools within Power BI Desktop for visualizing the data. The article offers several examples of how to add visualizations to a report to provide different perspectives of the data. The visualizations are based on a single dataset, created from data in the <strong>AdventureWorks2017<\/strong> sample database in SQL Server 2017.<\/p>\n<p>If you plan to try out the examples for yourself, you can use the following T-SQL statement to add a dataset to Power BI Desktop:<\/p>\n<pre class=\"lang:tsql theme:ssms2012-simple-talk\">SELECT h.SalesPersonID AS RepID,\r\n  CONCAT(p.LastName, ', ', p.FirstName) AS FullName, \r\n  a.City, sp.Name AS StateProvince, cr.Name AS Country, \r\n  h.OrderDate, h.SubTotal\r\nFROM Sales.SalesOrderHeader h \r\n  INNER JOIN Person.Person p\r\n    ON h.SalesPersonID = p.BusinessEntityID\r\n  INNER JOIN Person.BusinessEntityAddress ba\r\n    ON p.BusinessEntityID = ba.BusinessEntityID\r\n  INNER JOIN Person.Address a\r\n    ON ba.AddressID = a.AddressID\r\n  INNER JOIN Person.StateProvince sp\r\n    ON a.StateProvinceID = sp.StateProvinceID\r\n  INNER JOIN Person.CountryRegion cr\r\n    ON sp.CountryRegionCode = cr.CountryRegionCode\r\nWHERE h.SalesPersonID IS NOT NULL\r\nORDER BY FullName ASC;<\/pre>\n<p>For information about using a T-SQL query to create a dataset, refer to <a href=\"https:\/\/www.red-gate.com\/simple-talk\/sql\/bi\/power-bi-introduction-working-with-sql-server-data-in-power-bi-desktop-part-5\/\">Part 5<\/a> of this series.<\/p>\n<p>After you import the data into Power BI Desktop, change the name of the dataset to <em>Sales,<\/em> update the format of the <em>OrderDate<\/em> column to show only the dates (not the times), and update the <em>SubTotal<\/em> column to show whole number currency values.<\/p>\n<p>To update for the <em>OrderDate<\/em> column, select the dataset in <em>Data<\/em> view and then select the <em>OrderDate<\/em> column. On the <em>Modeling<\/em> ribbon, select <em>Date<\/em> from the <em>Date type<\/em> drop-down list. Next, click the <em>Format <\/em>drop-down list, point to <em>Date Time,<\/em> and click the format <em>2001-03-14 (yyyy-MM-dd)<\/em>.<\/p>\n<p>To update the <em>SubTotal<\/em> column, select the column in <em>Data<\/em> view and then select <em>Whole Number<\/em> from the <em>Data type<\/em> drop-down list. You should receive a warning message about the loss of data precision. Click <em>Yes<\/em> to continue. In the <em>Currency format<\/em> drop-down list, click <em>$ English (United States)<\/em>. In the <em>Decimal places<\/em> box, set the number of decimal places to <em>0<\/em>.<\/p>\n<h2>Getting started with Power BI Desktop Reports<\/h2>\n<p>With the dataset in place, you\u2019re ready to start adding visualizations to the report. But before you do, save the file if you haven\u2019t already done so. The file provides the structure necessary for publishing the report\u2014along with its visualizations and datasets\u2014to the Power BI service. Each file is associated with a single report made up of one or more pages, with each page containing the actual visualizations.<\/p>\n<p>To add a visualization to a report, go to <em>Report<\/em> view, where you\u2019re presented with a design surface and the <em>Visualizations<\/em> and <em>Fields<\/em> panes, as shown in the following figure. The design surface contains the report pages, with <em>Page 1<\/em> already added to the report.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1173\" height=\"645\" class=\"wp-image-80471\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2018\/08\/word-image-78.png\" \/><\/p>\n<p>The <em>Visualizations<\/em> pane provides the tools necessary for adding and configuring the visualizations. The <em>Fields<\/em> pane includes a list of the defined datasets, with access to each dataset column. The above figure indicates that the <em>Sales<\/em> dataset is the only visible dataset included in this report file. (In Power BI Desktop, you can configure a dataset to be hidden in <em>Report<\/em> view.)<\/p>\n<p>Most of the tasks you carry out in <em>Report<\/em> view are point-and-click or drag-and-drop operations. For example, to add a visualization to a report page, you simply click the visualization\u2019s button at the top of the <em>Visualizations<\/em> pane. Power BI Desktop will add the visualization to the design surface, where you can drag it to a different position or resize its window. You can then specify what data to add to the visualization by selecting columns from the <em>Fields<\/em> pane.<\/p>\n<p>When a visualization is selected on the design surface, Power BI Desktop updates the <em>Visualizations<\/em> pane to include configuration options specific to that visualization. For example, the following figure shows the <em>Visualizations<\/em> pane with a <em>Matrix<\/em> visual selected on the design surface. In this case, the <em>Country<\/em> and <em>FullName<\/em> columns have been added to the <em>Rows <\/em>section and the <em>OrderDate<\/em> column has been added to the <em>Columns<\/em> section, with the date hierarchy expanded. (We\u2019ll be getting into the details of how to add columns in just a bit.)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"226\" height=\"678\" class=\"wp-image-80472\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2018\/08\/word-image-79.png\" \/><\/p>\n<p>The top of the <em>Visualizations<\/em> pane contains the icon buttons you use to add visualizations to a report. The rest of the pane is specific to configurating the selected visualization. This part of the pane is divided into three tabs: <em>Fields, Format,<\/em> and <em>Analytics<\/em>. In the above figure, the <em>Fields<\/em> tab is selected, as indicated by the red circle. The options on this tab are used to apply data to the visualization.<\/p>\n<p>The second tab, <em>Format,<\/em> provides options for configuring how the selected visualization appears. The options are separated into categories, which are specific to the selected visualization. The following figure shows the <em>Format<\/em> categories for the <em>Matrix<\/em> visual.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"226\" height=\"680\" class=\"wp-image-80473\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2018\/08\/word-image-80.png\" \/><\/p>\n<p>The <em>Analytics<\/em> tab lets you add dynamic reference lines to certain types of visualizations. Later in the article, we\u2019ll be discussing this tab in more detail.<\/p>\n<h2>Creating a Matrix Visual<\/h2>\n<p>The best way to understand how to work with visualizations is to set them up for yourself. In this way, you get hands-on experience with the tools, while seeing how all the pieces fit together. For the first example, you\u2019ll add and configure a <em>Matrix<\/em> visual and two <em>Slicer<\/em> visuals. The following figure shows what they\u2019ll look like after you\u2019ve set them up. The visualization on the left is the <em>Matrix<\/em> visual and the two on the right are the <em>Slicer<\/em> visuals. The <em>Matrix<\/em> visual is selected in the figure, as indicated by the menu across the top of the visualization and the frame that surrounds it.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"763\" height=\"400\" class=\"wp-image-80474\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2018\/08\/word-image-81.png\" \/><\/p>\n<p>The <em>Matrix<\/em> visual aggregates measure data across both columns and rows, while supporting extensive drill-down capabilities, depending on the data and how you\u2019ve configured the matrix.<\/p>\n<p>To add the Matrix shown in the previous figure, take the following steps:<\/p>\n<ol>\n<li>Click the <em>Matrix<\/em> button in the top section of the <em>Visualizations<\/em> pane. This adds a placeholder object to the design surface, which is already selected.<\/li>\n<li>Drag the <em>Country<\/em> column from the <em>Fields<\/em> pane to the <em>Rows<\/em> section on the <em>Visualizations<\/em> pane.<\/li>\n<li>Drag the <em>FullName<\/em> column from the <em>Fields<\/em> pane to the <em>Rows<\/em> section on the <em>Visualizations<\/em> pane, directly beneath the <em>Country<\/em> column. By adding the <em>FullName<\/em> column after the <em>Country<\/em> column, you make it possible for users to drill down into the country to view data about the sales reps in that country.<\/li>\n<li>Drag the <em>OrderDate <\/em>column from the <em>Fields<\/em> pane to the <em>Columns<\/em> section on the <em>Visualizations<\/em> pane. Because the <em>OrderDate <\/em>column contains date values, Power BI Desktop automatically defines hierarchical levels that can be used to drill down into the data based on dates.<\/li>\n<li>Drag the <em>SubTotal <\/em>column from the <em>Fields<\/em> pane to the <em>Values <\/em>section on the <em>Visualizations<\/em> pane. The <em>SubTotal <\/em>column provides the measure on which the aggregations are based.<\/li>\n<\/ol>\n<p>The <em>Fields <\/em>tab on the <em>Visualizations<\/em> pane should now look like the one in the following figure.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"205\" height=\"365\" class=\"wp-image-80475\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2018\/08\/word-image-82.png\" \/><\/p>\n<p>After you add the data you need, you can configure the visual\u2019s settings on the <em>Format<\/em> tab to ensure it looks just the way you want, and the data can be easily understood. To make your matrix look similar to the one shown in the above figure, take the following steps:<\/p>\n<ol>\n<li>Expand the <em>Matrix style<\/em> section and select <em>Minimal<\/em> from the <em>Style<\/em> drop-down list.<\/li>\n<li>Expand the <em>Grid<\/em> section and set the <em>Vert grid<\/em> option to <em>On,<\/em> and then select the lightest yellow color for the <em>Vert grid color<\/em> option.<\/li>\n<li>Expand the <em>Column headers<\/em> section and set the <em>Text size <\/em>option to <em>12<\/em>.<\/li>\n<li>Expand the <em>Row headers<\/em> section and set the <em>Text size <\/em>option to <em>12<\/em>.<\/li>\n<li>Expand the <em>Values<\/em> section and set the <em>Text size <\/em>option to <em>10<\/em>.<\/li>\n<li>Expand the <em>Subtotals <\/em>section and set the <em>Text size <\/em>option to <em>10<\/em>.<\/li>\n<li>Expand the <em>Grand total <\/em>section and set the <em>Text size <\/em>option to <em>10<\/em>.<\/li>\n<li>Expand the <em>Title<\/em> section and set the <em>Title <\/em>option to <em>On<\/em>. In the <em>Title Text<\/em> box, type <em>Sales by Country,<\/em> and set the <em>Font color<\/em> option to the darkest aquamarine. In the <em>Alignment<\/em> subsection, click the <em>Center<\/em> option, and then set the <em>Text size<\/em> option to <em>17<\/em>.<\/li>\n<li>In the <em>Border<\/em> section, set the option to <em>On<\/em>.<\/li>\n<\/ol>\n<p>Your <em>Matrix<\/em> visual should now be in fairly good shape. Going forward, I\u2019ll leave it up to you to decide how to configure the settings on the <em>Format<\/em> tab, based on your own preferences. The main thing to keep in mind when formatting a visualization is to make sure it\u2019s selected on the design surface.<\/p>\n<p>When you select a <em>Matrix <\/em>visual on the design surface, drop-down list is available for choosing whether drill-down operations are based on columns or rows, as shown in the following figure.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"659\" height=\"291\" class=\"wp-image-80476\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2018\/08\/word-image-83.png\" \/><\/p>\n<p>To test this out, select <em>Columns<\/em> from the <em>Drill on<\/em> drop-down list, and then click the button <em>Expand all down one level in the hierarchy<\/em> (third button to the right of the drop-down list). When you click the button, the matrix provides a breakdown of the aggregated data based on quarters as well as years, as shown in the following figure.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"869\" height=\"323\" class=\"wp-image-80477\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2018\/08\/word-image-84.png\" \/><\/p>\n<p>To return to the previous view, click the <em>Drill Up<\/em> button just to the right of the <em>Drill on<\/em> drop-down list. Next, click the button <em>Click to turn on Drill Down<\/em> near the top right corner to turn on drill-down capabilities directly within the matrix. When this button is selected, its shading is reversed.<\/p>\n<p>With drill-down enabled, click the <em>2013<\/em> column header. The matrix will now display data specific to that year, as shown in the following figure.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"530\" height=\"308\" class=\"wp-image-80478\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2018\/08\/word-image-85.png\" \/><\/p>\n<p>As already noted, Power BI Desktop automatically creates a hierarchy based on the date values, with years at the top, then quarters, next months, and finally days. You can drill down into all levels within a <em>Matrix<\/em> visual. For example, to drill into the first quarter, click the <em>Qtr 1<\/em> column header, which allows you to view sales data at the month level, as shown in the following figure.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"510\" height=\"286\" class=\"wp-image-80479\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2018\/08\/word-image-86.png\" \/><\/p>\n<p>If you select the <em>Rows <\/em>option in the <em>Drill on<\/em> drop-down list, instead of the <em>Columns<\/em> option, you will see different results when drilling into the data. For example, if you click the name of a country in the <em>Country<\/em> column, the matrix will display a list of sales reps for that country, along with their sales totals. Give it a try and see how to goes.<\/p>\n<p>You can also view a visualization in Focus mode, which enlarges the visualization so that it uses the entire design surface. To view a visual in focus mode, click the <em>Focus mode<\/em> button near the top right corner. Your <em>Matrix<\/em> visual should now look similar to the one in the following figure. To return back to the regular view of the design surface, click the <em>Back to Report<\/em> button.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"768\" height=\"353\" class=\"wp-image-80480\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2018\/08\/word-image-87.png\" \/><\/p>\n<p>You can also add slicers to your reports that provide a way for users to filter the data within the visualization. For this exercise, you will add two slicers, one for countries and one for years.<\/p>\n<p>To add the <em>Country<\/em> slicer, verify that no visualizations are selected on the design surface, and then click the <em>Slicer<\/em> button at the top of the <em>Visualizations<\/em> pane, as shown in the following figure. The <em>Slicer<\/em> button is outlined in yellow to indicate that it is the selected visual type.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"203\" height=\"361\" class=\"wp-image-80481\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2018\/08\/word-image-88.png\" \/><\/p>\n<p>Next, drag the <em>Country<\/em> column from the <em>Fields<\/em> pane to the <em>Field<\/em> section in the <em>Visualizations<\/em> pane. You can then move and resize the slicer, as well as apply formatting. Power BI Desktop will automatically link the slicer to any related visualizations on that page. You might also need to change the slicer type from a dropdown list to a regular list of items so the slicer is more readable. To change the type, click the down arrow within the slicer visual itself, near the top right corner, and then select <em>List<\/em>.<\/p>\n<p>To add the <em>Year <\/em>slicer, take the same steps as you did for the <em>Country<\/em> slicer, only this time, add the <em>OrderDate<\/em> column. Next, click the column\u2019s down arrow (on the <em>Visualizations<\/em> pane), and click <em>Date Hierarchy<\/em>. Power BI Desktop adds only the <em>Year <\/em>level to the slicer. Again, you might need to change the slicer type from <em>Dropdown<\/em> to <em>List<\/em>.<\/p>\n<p>When formatting the two slicers, you can add a <em>Select All<\/em> value to the list of available values. To add the value, go to the <em>Format<\/em> tab on the <em>Visualizations<\/em> pane, expand the <em>Selection Controls<\/em> category, and set the <em>Show \u201cSelect All\u201d<\/em> option to <em>On<\/em>.<\/p>\n<p>To test the new slicers, select <em>France, Germany,<\/em> and <em>United Kingdom<\/em> in the <em>Country<\/em> slicer, and select <em>2013<\/em> and <em>2014<\/em> in the <em>Year<\/em> slicer. To select multiple values in a slicer, select the first value, press <em>Control<\/em>, and select the remaining values. Your visualizations should now look like those shown in the following figure.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"730\" height=\"399\" class=\"wp-image-80482\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2018\/08\/word-image-89.png\" \/><\/p>\n<p>Once you\u2019ve mastered how to add and configure a <em>Matrix <\/em>visual, you\u2019ll find that many of the concepts introduced here will apply to other visualizations. Just be certain to save your report file regularly to ensure that none of your changes get lost.<\/p>\n<h2>Creating Table and Card Visuals<\/h2>\n<p>When you add columns to a visualization, Power BI Desktop will often summarize the data to provide a big-picture perspective of the information. You saw this with the <em>Matrix<\/em> visual in the previous section, in which the <em>SubTotal<\/em> column (the measure) was aggregated across the <em>Country<\/em> and <em>OrderDate<\/em> columns to provide subtotals for each discrete group.<\/p>\n<p>In some cases, you might not want the data automatically aggregated. For example, you might want to add a <em>Table<\/em> visual that lists individual Canadian sales only. To add this table, click the <em>Plus<\/em> button at the bottom of the design surface to insert a second page. Next, click the <em>Table<\/em> button on the <em>Visualizations<\/em> pane, and then add the <em>RepID, FullName, OrderDate,<\/em> and <em>SubTotal<\/em> columns to the <em>Values<\/em> section of the <em>Visualizations<\/em> tab.<\/p>\n<p>Power BI Desktop will automatically try to summarize the <em>RepID<\/em> and <em>SubTotal<\/em> columns because they contain numerical values, using the <em>Count<\/em> and <em>Sum<\/em> aggregate functions, respectively. For each of these two columns, click the column\u2019s down arrow (in the <em>Visualizations<\/em> pane), and select <em>Don\u2019t summarize,<\/em> as shown in the following figure. Power BI Desktop will update the data to include individual rows.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"398\" height=\"675\" class=\"wp-image-80483\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2018\/08\/word-image-90.png\" \/><\/p>\n<p>When you add a date column to the <em>Table<\/em> visual, Power BI Desktop automatically breaks the dates into hierarchical levels, which results in four columns (<em>Year, Quarter, Month,<\/em> and <em>Day<\/em>). If you want a single date column instead, you must reset the <em>OrderDate<\/em> column. In the <em>Visualizations<\/em> pane, click the column\u2019s down-arrow and select <em>OrderDate<\/em>. Power BI Desktop will update the table so the entire <em>OrderDate<\/em> value is listed in a single column.<\/p>\n<p>The last step is to filter out all rows except the Canadian sales. To filter the data, drag the <em>Country<\/em> column from the <em>Fields<\/em> pane to the <em>Visual level filters<\/em> subsection in the <em>Filters<\/em> section of the <em>Visualizations<\/em> pane. Expand the <em>Country<\/em> section if not already expanded and select the <em>Canada<\/em> checkbox, as shown in the following figure.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"227\" height=\"509\" class=\"wp-image-80484\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2018\/08\/word-image-91.png\" \/><\/p>\n<p>Once you\u2019ve set up the data, position and resize the <em>Table<\/em> visual and apply the necessary formatting. Your table should now look similar to the one shown in the following figure but formatted according to your preferences.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"617\" height=\"499\" class=\"wp-image-80485\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2018\/08\/word-image-92.png\" \/><\/p>\n<p>The figure also shows a second visual, which is a <em>Multi-row card.<\/em> In this case, the card displays the name of each Canadian sales rep, along with the total sales for that rep.<\/p>\n<p>To add this card, verify that the <em>Table<\/em> visual is not selected and then click the <em>Multi-row card<\/em> button on the <em>Visualizations<\/em> pane. Next, drag the <em>FullName<\/em> column from the <em>Fields<\/em> pane to the <em>Fields<\/em> section of the <em>Visualizations<\/em> pane, and then do the same for the <em>SubTotal <\/em>column. Finally, set up the same filter you set up for the <em>Table<\/em> visual so that only Canadian sales reps are listed. Position, resize, and format the card as necessary, and be sure to save the report file.<\/p>\n<h2>Creating Pie, Donut, and Treemap Charts<\/h2>\n<p>In the next example, you\u2019ll add a page to the report and then add three visuals: <em>Pie chart, Donut chart, <\/em>and <em>Treemap<\/em>. The visualizations will display sales information for all countries except the United States. Although you\u2019ll be creating three different types of visualizations, you\u2019ll configure them exactly the same.<\/p>\n<p>To add the <em>Pie chart<\/em> visual, take the following steps:<\/p>\n<ol>\n<li>Click the <em>Plus <\/em>button to add a new page, and then click the <em>Pie chart<\/em> button on the <em>Visualizations <\/em>pane.<\/li>\n<li>Drag the <em>Country <\/em>column from the<em> Fields<\/em> pane to the <em>Details<\/em> section of the <em>Visualizations<\/em> pane.<\/li>\n<li>Drag the <em>Subtotal <\/em>column from the<em> Fields<\/em> pane to the <em>Values<\/em> section of the <em>Visualizations<\/em> pane.<\/li>\n<li>Expand the <em>Country<\/em> column in the <em>Filters<\/em> section and select all countries except the US.<\/li>\n<li>Position, resize, and format the visualization as necessary.<\/li>\n<\/ol>\n<p>Once you have the first visualization exactly as you want to, you can create the next one, using the following steps:<\/p>\n<ol>\n<li>Ensure that the <em>Pie chart<\/em> visual is selected.<\/li>\n<li>Click <em>Copy<\/em> on the <em>Home<\/em> ribbon, and then click <em>Paste<\/em>. A copy of the original visualization is added to the design surface.<\/li>\n<li>Drag the copied visual to its new position.<\/li>\n<li>Click the <em>Donut chart<\/em> button on the <em>Visualizations<\/em> pane.<\/li>\n<\/ol>\n<p>When you click one of the visualization buttons and a visualization is already selected, Power BI Desktop tries to apply the newly selected visual to the original configuration. This means that the visuals need to compatible with each other for this to work, like the two you just added.<\/p>\n<p>The next step is to add the <em>Treemap <\/em>visual, taking the same approach as with the <em>Donut chart<\/em> visual. Copy and paste one of the other visuals and then click the <em>Treemap <\/em>button at the top of the <em>Visualizations <\/em>pane. When you\u2019re finished, you should end up with three visuals similar to those shown in the following figure.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"936\" height=\"337\" class=\"wp-image-80486\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2018\/08\/word-image-93.png\" \/><\/p>\n<p>The visuals are positioned in the order they were created: <em>Pie chart, Donut chart, <\/em>and <em>Treemap<\/em>. Normally, you would not add such similar visuals to the same page unless you had a compelling reason, but what we\u2019ve done here demonstrates how easy it is to copy a visualization and change it to a different type.<\/p>\n<p>In the figure above, the <em>Treemap<\/em> visual also shows a pop-up message, which appears when you hover over a section of the visual. In this case, the pop-up is showing the total sales for the United Kingdom, but you can get information for any category on any of the three visualizations. In fact, most visualizations in Power BI Desktop support this feature.<\/p>\n<h2>Creating a Clustered Column Chart<\/h2>\n<p>The next visualization you will add is a <em>Clustered column chart<\/em> that shows US sales information for each sales rep with over $1 million in annual sales. The following steps walk you through the process of adding the visualization:<\/p>\n<ol>\n<li>Click the <em>Plus<\/em> button to add a new page to the report, and then click the <em>Clustered column chart<\/em> button on the <em>Visualizations<\/em> pane.<\/li>\n<li>Drag the <em>FullName <\/em>column from the<em> Fields<\/em> pane to the <em>Axis<\/em> section of the <em>Visualizations<\/em> pane. The axis provides the foundation on which the chart is built.<\/li>\n<li>Drag the <em>OrderDate <\/em>column from the<em> Fields<\/em> pane to the <em>Legend<\/em> section of the <em>Visualizations<\/em> pane. The legend determines how data will be clustered.<\/li>\n<li>In the <em>Visualizations<\/em> pane, click the <em>OrderDate <\/em>column\u2019s down arrow, and then select <em>Date Hierarchy<\/em>. Power BI Desktop automatically limits the hierarchy to the <em>Year<\/em> level.<\/li>\n<li>Drag the <em>SubTotal <\/em>column from the<em> Fields<\/em> pane to the <em>Value<\/em> section of the <em>Visualizations<\/em> pane. The value serves as the measure used for aggregating the data.<\/li>\n<li>Drag the <em>Country <\/em>column from the<em> Fields<\/em> pane to the <em>Visual level filters<\/em> subsection in the <em>Filters<\/em> section of the <em>Visualizations<\/em> pane. Expand the <em>Country<\/em> section and select <em>United States<\/em> to include only that country.<\/li>\n<li>In the <em>Filters<\/em> section of the <em>Visualizations<\/em> pane, expand the <em>SubTotal <\/em>section, select <em>is greater than<\/em> from the first drop-down list, type <em>1000000<\/em> in the text box directly below the list, and click <em>Apply filter<\/em>. By applying this filter, only sales totals greater than $1 million will be included in the visualization.<\/li>\n<li>Position, resize, and format the visualization as necessary.<\/li>\n<\/ol>\n<p>Your visualization should now look similar to the one shown in the following figure, except that it won\u2019t include the red analytics line. You\u2019ll be adding that shortly.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"721\" height=\"541\" class=\"wp-image-80487\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2018\/08\/word-image-94.png\" \/><\/p>\n<p>Analytics is a feature in Power BI Desktop that lets you add dynamic reference lines to a visual to provide additional insights into the data or reflect important trends. The analytic in the above figure shows the average sales amount based on values in the <em>SubTotal <\/em>column. To add this analytic, take the following steps:<\/p>\n<ol>\n<li>Ensure that the <em>Clustered column chart<\/em> visual is still selected on the design surface.<\/li>\n<li>In the <em>Visualizations<\/em> pane, go to the <em>Analytics<\/em> tab, expand the <em>Average Line <\/em>section, and click <em>Add.<\/em><\/li>\n<li>In the text box at the top of the <em>Average Line <\/em>section, change the default name to <em>Average<\/em>.<\/li>\n<li>From the <em>Measure<\/em> drop-down list, select <em>SubTotal<\/em> if it\u2019s not already selected.<\/li>\n<li>Configure the formatting settings as desired. You format the analytic directly on the <em>Analytics<\/em> tab when adding the analytic. For example, you can configure the analytic\u2019s color, percentage of transparency, and line style.<\/li>\n<\/ol>\n<p>The following figure shows how I configured the analytic on my system.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"261\" height=\"509\" class=\"wp-image-80488\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2018\/08\/word-image-95.png\" \/><\/p>\n<p>You can add whatever analytics you think will be serve your purpose. Note, however, that not all visualizations support analytics.<\/p>\n<h2>Creating a Filled Map<\/h2>\n<p>In this last example, you\u2019ll add a <em>Filled map<\/em> visual and then a <em>Table<\/em> visual that contains data corresponding to the map. The <em>Filled map<\/em> visual uses patterns or shading to show how values differ across geographic regions. The visual relies on Microsoft\u2019s Bing service to provide default map longitude and latitude coordinates. As a result, you must be online when working with the <em>Filled map<\/em> visual for the map to fully render on the design surface.<\/p>\n<p>To add a <em>Filled map<\/em> visual based on the <em>Sales<\/em> dataset, take the following steps:<\/p>\n<ol>\n<li>Click the <em>Plus<\/em> button to add a new page to the report, and then click the <em>Filled map<\/em> button on the <em>Visualizations<\/em> pane.<\/li>\n<li>Drag the <em>StateProvince <\/em>column from the<em> Fields<\/em> pane to the <em>Location<\/em> section of the <em>Visualizations<\/em> pane. Power BI Desktop will automatically use these values to come up with their coordinates, leveraging the Bing service.<\/li>\n<li>Drag the <em>SubTotal <\/em>column from the<em> Fields<\/em> pane to the <em>Color saturation <\/em>section of the <em>Visualizations<\/em> pane. The column serves as the measure used for aggregating totals and arriving at the state shading.<\/li>\n<li>Drag the <em>Country <\/em>column from the<em> Fields<\/em> pane to the <em>Visual level filters<\/em> subsection in the <em>Filters<\/em> section of the <em>Visualizations<\/em> pane. Expand the <em>Country<\/em> section and select <em>United States.<\/em>.<\/li>\n<li>Position, resize, and format the visualization as necessary.<\/li>\n<\/ol>\n<p>That\u2019s all there is to adding the <em>Filled map<\/em> visual. You can then add the <em>Table<\/em> visual, using the following steps:<\/p>\n<ol>\n<li>Ensure that the <em>Filled map<\/em> visual is not selected on the design surface, and then click the <em>Table<\/em> button on the <em>Visualizations<\/em> pane.<\/li>\n<li>Drag the <em>StateProvince,<\/em> <em>FullName,<\/em> and <em>SubTotal<\/em> columns from the<em> Fields<\/em> pane to the <em>Values <\/em>section of the <em>Visualizations<\/em> pane.<\/li>\n<li>Drag the <em>Country <\/em>column from the<em> Fields<\/em> pane to the <em>Visual level filters<\/em> subsection in the <em>Filters<\/em> section of the <em>Visualizations<\/em> pane. Expand the <em>Country<\/em> section and select <em>United States.<\/em><\/li>\n<li>Position, resize, and format the visualization as necessary.<\/li>\n<\/ol>\n<p>Your visualizations should now look similar to those shown in the following figure.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"927\" height=\"479\" class=\"wp-image-80489\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2018\/08\/word-image-96.png\" \/><\/p>\n<p>Power BI Desktop automatically links visualizations located on the same report page. As a result, when you select an item in one visualization, the data is updated in the other visualizations. For example, in the following figure, Washington state is selected in the <em>Filled map<\/em> visual. As a result, the <em>Table<\/em> visual now includes only data about sales in Washington state.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"932\" height=\"503\" class=\"wp-image-80490\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2018\/08\/word-image-97.png\" \/><\/p>\n<p>Linked visuals can be a handy way to allow users to gain quick insights into the same data from different perspectives, without having to create lots of extra visualizations. This also works for slicers as well, which are added at the page level, again providing a simple way to offer different perspectives into the data.<\/p>\n<h2>Lots More Where That Came From<\/h2>\n<p>Power BI Desktop supports a number of visualizations in addition to what we\u2019ve covered here. For most of those visualizations, you can apply many of the same concepts that were demonstrated in this article. Power BI Desktop also supports the ability to use R scripts to create visualizations or to import R-based custom visualizations, as described in the <a href=\"https:\/\/www.red-gate.com\/simple-talk\/sql\/bi\/power-bi-introduction-working-with-r-scripts-in-power-bi-desktop-part-3\/\">Part 3<\/a> of this series.<\/p>\n<p>Regardless of the visualization type, the best way to learn how to build reports in Power BI Desktop is to experiment with the visualizations themselves, trying out different ones against the same data or different data. The more time you spend working directly with these features, the better you\u2019ll understand their capabilities and the quicker you\u2019ll be able to create visualizations that provide meaningful insights into the data. Power BI Desktop offers a solid foundation for building effective business intelligence reports, but it\u2019s up to you to figure out what it takes to get there.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Power BI contains rich visualizations that allow anyone to build insightful dashboards. In this article, Robert Sheldon shows you how to create Power BI charts, tables, maps, and slicers,   &hellip;<\/p>\n","protected":false},"author":221841,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[143528],"tags":[],"coauthors":[6779],"class_list":["post-80470","post","type-post","status-publish","format-standard","hentry","category-bi-sql-server"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/80470","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/users\/221841"}],"replies":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/comments?post=80470"}],"version-history":[{"count":6,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/80470\/revisions"}],"predecessor-version":[{"id":80494,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/80470\/revisions\/80494"}],"wp:attachment":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/media?parent=80470"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/categories?post=80470"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/tags?post=80470"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/coauthors?post=80470"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}