Redaguoti

Bendrinti naudojant


Tutorial: From Excel workbook to stunning report in Power BI Desktop

APPLIES TO: Power BI Desktop Power BI service

In this tutorial, you build a beautiful report from start to finish in 20 minutes!

Screenshot of your completed Power B I report in the Power B I service.

Your manager wants to see a report on your latest sales figures. They've requested an executive summary of:

  • Which month and year had the most profit?
  • Where is the company seeing the most success (by country/region)?
  • Which product and segment should the company continue to invest in?

Using our sample finance workbook, we can build this report in no time. Here’s what the final report will look like. Let’s get started!

In this tutorial, you'll learn how to:

  • Download sample data.
  • Prepare your data with a few transformations.
  • Build a report with a title, three visuals, and a slicer.
  • Publish your report to the Power BI service so you can share it with your colleagues.

Prerequisites

Get data

You can get the data for this tutorial using one of two methods: connect to the sample directly from Power BI Desktop, or download and open it in Power BI Desktop.

Get data in Power BI Desktop

When you open Power BI Desktop, select Learn with sample data from the Home page.

Screenshot of Learn with sample data tile highlighted in Power B I Desktop.

In the dialog that opens, choose Load sample data.

Screenshot of Two ways to use sample data > Load data.

Download the sample

You can also download the sample workbook directly.

  1. Download the Financial Sample Excel workbook.
  2. Open Power BI Desktop.
  3. On the Home page, select Excel workbook.
  4. Navigate to where you saved the sample workbook and select Open.

Prepare your data

In Navigator, you have the option to transform or load the data. The Navigator provides a preview of your data so you can verify that you have the correct range of data. Numeric data types are italicized. If you need to make changes, transform your data before loading. To make the visualizations easier to read later, we want to transform the data for this exercise. As you make each transformation in Power Query Editor, you see it added to the list under Query Settings in APPLIED STEPS.

  1. Select the checkbox for the financials table, then select Transform Data.

    Screenshot of Power BI Navigator with Financial sample data.

  2. The Power Query Editor opens. Select the Units Sold column. On the Transform tab, select Data Type, then select Whole Number. In the Change Column Type dialog that opens, choose Replace current.

    Changing data types is the data cleaning step that users do most often. In this case, the units sold are in decimal form. It doesn’t make sense to have 0.2 or 0.5 of a unit sold, so we changed it to a whole number.

    Screenshot of changing a decimal number to a whole number.

  3. We want to make the segments easier to see in the chart later, so let’s format the data in the Segment column. Select the Segment column. On the Transform tab, select Format, then select UPPERCASE.

    Screenshot of changing the format from lowercase to uppercase.

  4. Let's shorten the column name from Month Name to just Month. Double-click the Month Name column, and rename it to Month.

    Screenshot of column name selected for editing.

  5. On the Product column header, select the dropdown and clear the box next to Montana.

    We know the Montana product was discontinued last month, so we want to filter this data from our report to avoid confusion.

    Screenshot of cleared checkbox for Montana value.

  6. You can see that each transformation has been added to the list under Query Settings in APPLIED STEPS.

    Screenshot of transformations listed in applied steps.

  7. Back on the Home tab, select Close & Apply. Our data is almost ready for building a report.

    The sigma symbol in the Data list indicates a field that Power BI has detected is numeric. Power BI uses a calendar symbol to denote a date field.

    Screenshot of Data list with numeric fields and date field.

Extra credit: Write two expressions in DAX

Writing measures and creating tables in the DAX formula language is super powerful for data modeling. There's lots to learn about DAX in the Power BI documentation. For now, let's write a basic expression to create a new measure, and another expression to create a whole table.

Create a new measure

  1. On the Home ribbon, select New measure.

    Screenshot of New measure icon on the Home ribbon.

  2. Copy and paste this expression in the formula bar at the top of the report canvas to add all the numbers in the Units Sold column.

    Total Units Sold = SUM(financials[Units Sold])    
    
  3. Select the check mark to commit. The measure is added to the list in the Data pane.

    Screenshot of DAX expression Total Units Sold.

Create a new table

  1. Now select the Table view icon on the left.

    Screenshot of Table view icon in Power B I Desktop.

  2. On the Home ribbon, select New table.

    Screenshot of New Table button in the Home ribbon.

  3. Copy and paste this expression in the formula bar to generate a Calendar table of all dates between January 1, 2013, and December 31, 2014.

    Calendar = CALENDAR(DATE(2013,01,01),Date(2014,12,31))    
    
  4. Select the check mark to commit.

    Screenshot of DAX expression to create a calendar table.

    Here are the first 23 rows of the single-column table you just created.

    Screenshot of calendar table created with DAX expression.

  5. Now select Model view on the left.

    Screenshot of model view icon in Power B I Desktop.

  6. Drag the Date field from the financials table to the Date field in the Calendar table to join the tables and create a relationship between them. In the New relationship dialog that opens, select Save to apply the selections that Power BI automatically filled in for you.

    Screenshot of relationship between Date fields.

Build your report

Now that you've transformed and loaded your data, it's time to create your report. In the left rail, select Report view.

Screenshot of report view icon in Power B I Desktop.

In the Data pane on the right, you see the fields in the data model you created.

Let’s build the final report, one visual at a time.

Screenshot of all the elements of the report, by number.

Visual 1: Add a title

  1. On the Insert ribbon, select Text box. Inside the text box, type “Executive Summary – Finance Report”.

  2. Select the text you typed. Make the font bold and set the size to 20.

    Screenshot of text box title selected for formatting.

  3. Resize the box to fit on one line.

Visual 2: Profit by date

Now you create a line chart to see which month and year had the highest profit.

  1. From the Data pane, drag the Profit field to a blank area on the report canvas. By default, Power BI displays a column chart with one column, Profit.

  2. Drag the Date field to the same visual. Power BI updates the column chart to show monthly profit for the two years.

    If you created a Calendar table in Extra credit: Create a new table earlier in this article, expand the Date field in the Data pane, then select the checkbox for Date Hierarchy. Expand the field, then clear the checkboxes next to the Quarter and Day fields to display only Year and Month on the chart. Alternatively, remove the fields from where they're listed in the X-axis well on the Build visual tab of the Visualizations pane.

    Screenshot of column chart showing profit by month for two different years.

  3. On the Build visual tab, change the visualization type to Line chart.

    Screenshot of changing column to line chart.

    Now you can easily see that December 2014 had the highest profit.

Visual 3: Profit by country/region

Create a map to see which country/region had the highest profits.

  1. From the Data pane, drag the Country field to a blank area on your report canvas to create a map.

  2. Drag the Profit field to the map.

    Power BI adds bubbles representing the relative profit of each location to the map visual.

    Screenshot of map visual showing profit by country.

    Europe seems to be performing better than North America.

Visual 4: Sales by product and segment

Create a bar chart to determine which companies and segments to invest in.

  1. Drag the two charts you've created to be side by side in the top half of the canvas. Save some room on the left side of the canvas.

  2. Select a blank area in the lower half of your report canvas.

  3. In the Data pane, select the Sales, Product, and Segment fields.

    Power BI automatically creates a clustered column chart visualizing the data.

  4. Drag the handles on the chart so it's wide enough to fill the space under the two other visuals.

    Screenshot of line chart and map visual positioned under report title and over column chart.

    It looks like the company should continue to invest in the Paseo product and target the Small Business and Government segments.

Visual 5: Year slicer

Slicers are a valuable tool for filtering the visuals on a report page to a specific selection. In this case, we can create two different slicers to narrow in on performance for each month and year. One slicer uses the Date field in the original table. The other uses the Date table you may have created for "extra credit" earlier in this tutorial.

Date slicer using the original table

  1. In the Data pane, select the Date field in the financials table. Drag it to the blank area you reserved on the canvas.

  2. In the Visualizations pane, choose Slicer.

    Slicer is the icon with a funnel next to a tab, but without the small lightning bolt. Power BI automatically creates a numeric range slicer.

    Screenshot of Date numeric range slicer.

  3. You can drag the ends to filter the date range. You can also change to a different type of slicer on the Visualization pane's Format visual tab. The options are under Visual > Slicer settings > Options > Style.

Date slicer using the DAX table

  1. In the Data pane, select the Date field in the Calendar table. Drag it to the blank area on the canvas.

  2. On the Visualizations pane's Build visual tab, choose Slicer.

  3. In the Data pane, expand the Data field and clear the boxes for Quarter and Day so only Year and Month are left.

    Screenshot of changing the Date hierarchy.

  4. Expand each year and resize the visual so that all months are visible.

    Screenshot of date hierarchy slicer with both years expanded to show all months.

    We'll use this slicer in the finished report.

Now, if your manager asks to see just 2013 data, you can use the slicer to select that year, or specific months of that year.

Extra credit: Format the report

If you want to do some light formatting on this report to add more polish, here are a few easy steps.

Theme

  • On the View ribbon, change the theme to Executive.

    Screenshot of selecting the Executive theme.

Spruce up the visuals

With the appropriate visual selected, make the following changes on the Visualizations pane.

  1. Select Visual 2, the column chart showing profit over time. Under Format visual > General, expand the Title section. Change the text in the Text field to “Profit by Month and Year” and change the Font size to 16. Expand Effects and toggle Shadow to On.

  2. Select Visual 3, the map. Under Format visual > Visual, expand Map settings and Style, then choose Grayscale. Under Format visual > General, expand the Title section and change the Font size to 16. Expand Effects and toggle Shadow to On.

  3. Select Visual 4, the clustered column chart showing sales by product and segment. Under Format visual > General, expand the Title section. Change the Font size to 16. Expand Effects and toggle Shadow to On.

  4. Select Visual 5, the year slicer. Under Format visual > Visual, expand Slicer settings > Selection and toggle Show "Select all" option to On. In the Slicer header section, increase the Font size to 16.

Add a background shape for the title

  1. On the Insert tab in the ribbon at the top, select Shapes > Rectangle. Place it at the top of the page and adjust the dimensions to be the width of the page and height of the title.

  2. In the Format shape pane, under Shape, expand the Style section and set Border to Off.

  3. In the Fill section, change Color to Theme color 5 #6B91C9 (blue).

    Screenshot of Theme color 5 highlighted.

  4. On the Format tab in the ribbon, select Send backward > Send to back to position the shape behind the title text.

  5. Select the text in Visual 1, the title, and change the font color to White.

Add a background shape for Visuals 2 and 3

  1. On the Insert tab in the ribbon at the top, select Shapes > Rectangle, then adjust the dimensions to be the width and height of Visuals 2 and 3.
  2. In the Format shape pane, on the Shape tab, expand the Style and Border sections and change the Transparency value to 100%.
  3. In the Fill section, set the Color to White, 10% darker.
  4. On the Format tab in the ribbon, select Send backward > Send to back to position the rectangle behind the visuals.

Finished report

Here's how your final, polished report will look:

Screenshot of final, formatted report in Power B I Desktop.

In summary, this report answers your manager’s top questions:

  • Which month and year had the most profit?

    December 2014.

  • Which country/region is the company seeing the most success in?

    In Europe, specifically France and Germany.

  • Which product and segment should the company continue to invest in?

    The company should continue to invest in the Paseo product and target the Small Business and Government segments.

Save your report

  • On the File menu, select Save, or hold Ctrl and then press the S key. If you're saving the report for the first time, you're prompted for a name and location to save it to.

Publish to the Power BI service to share

To share your report with your manager and colleagues, publish it to the Power BI service. When you share with colleagues that have a Power BI account, they can interact with your report, but can’t save changes.

  1. In Power BI Desktop, select Publish on the Home tab.

    You might need to sign in to the Power BI service. If you don't have an account yet, you can sign up for a free trial.

  2. Select a destination in the Power BI service where the report will be saved, such as My workspace.

  3. Select Open 'your-file-name' in Power BI.

    Screenshot of opening your report in the Power BI service.

    Your published report opens in the browser.

    Screenshot of your completed Power B I report in the Power B I service.

  4. Select Share at the top of the report to share your report with others.

More questions? Try the Power BI Community.