Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Power excel 2016 with mrexcel Master Pivot Tables, Subtotals, Charts, VLOOKUP, IF, Data Analysis in Excel 2010–2013 (Bill Jelen) (z-lib.org).pdf
Скачиваний:
4
Добавлен:
14.08.2022
Размер:
49.75 Mб
Скачать

392

POWER EXCEL WITH MR EXCEL

 

 

DOWNLOAD POWER BI DESKTOP TO YOUR COMPUTER

In the early days of Power BI, everything was done online. You would upload your data to PowerBI.Micro- soft.com and try to use clunky online tools to build your dashboard. Then, during 2016, Microsoft released

PowerBI Desktop.

This application allows you to do all of the dashboard design locally on your computer. Dashboards are saved as .pbix files.

The rest of the Power BI topics in this section will walk you through building a dashboard in Power BI Desktop and then uploading that dashboard to the cloud.

PREPARE YOUR EXCEL DATA FOR POWER BI

Power BI can import Excel files, but the data should either be stored in a named range or as a Table.

While table is a generic term, when this book refers to a Table, it means that you’ve used either Ctrl+T or Format as Table to convert your range into a Table.

To qualify as a Table, your data should have one row of headings above the data. You should have no blank headings. If the headings are not in Row 1, then make sure to leave a blank row between the headings and any title cells in the worksheet. There should be no blank rows in your data.

Select one cell in the data and press Ctrl+T. Excel will identify the extent of the data. Make sure that the My Data Has Headings box is checked and click OK.

PART 3: WRANGLING DATA

393

 

 

Figure 996 Format your ranges as Tables before loading to Power BI.

By default, Excel will automatically assign unimaginative names such as Table1. Go to the Table Tools

Design tab. You will see the table name in the top left.

Figure 997 The default table name.

Click in the box and type a logical name for the table. Do not include spaces in the name. Sales, Data, SalesData, Geography, GeographyLookup are all fine table names.

3

Figure 998 Give each table a logical name.

ADD A CALENDAR TABLE

As your Power BI skills advance, you may start writing DAX formulas that rely on time intelligence. These functions work better when you have a calendar table in the data model.

It is simple to create a calendar table. Insert a new worksheet in your workbook. Find the earliest and lat- est dates in your data. With a heading of Date in A1, put the earliest date in cell A2. Select A2 and drag the fill handle down to add dates in column A until you have enough dates to get you through the latest date. If you are building a dashboard in September and you expect to add more data for the rest of the year, it is fine to have the calendar table go through the end of the year.

Add columns such as Month, MonthNumber, Year, Quarter. Month Number might seem like a silly col- umn to have, but you will have to teach Power BI that month names need to be sorted by month number, or your reports will end up sorted in alphabetical month sequence: Apr, Aug, Dec, Feb, Jan, Jul, Jun, Mar,

May, Nov, Oct, Sep.

The formulas used in the following figure are =TEXT(A2,"MMM"), =MONTH(A2), =YEAR(A2), =CHOOSE(B2,"Q1","Q1","Q1", "Q2","Q2","Q2", "Q3","Q3","Q3", "Q4","Q4","Q4").

Figure 999 Add a Calendar Table to your workbook.

394

POWER EXCEL WITH MR EXCEL

 

 

 

THREE ICONS IN POWER BI DESKTOP

Open Power BI Desktop. There are three main modes available as icons along the left edge of the screen.

Figure 1000 Icons along the left edge control which view you are seeing.

The Reports view starts as a large white canvas where you can build visualizations. The Data view shows the tables you've loaded. The Relationships view shows how tables or queries are connected to each other.

IN POWER BI DESKTOP, THE POWER QUERY TOOLS ARE CALLED GET DATA

Power BI can load data from Excel, CSV, Access, SQL Server and many other sources. The entry point is the Get Data icon on the Home tab.

Figure 1001 If you've used Power Query in Excel, the same functionality is here.

Power BI can also load Hadoop, R scripts, or data from Quickbooks Online.

PART 3: WRANGLING DATA

395

 

 

Figure 1002 There is a long list of data sources.

LOAD YOUR EXCEL DATA TO POWER BI DESKTOP

3

If you want to follow along, use the PowerBISampleData.xlsx from the download files. This workbook has a 563-row data set spanning two years. Lookup table provide a geography lookup and a calendar lookup.

From Power BI Desktop, use Home, Get Data, Excel. Browse to your Excel file. A dialog will show a list of available tables, named ranges, and worksheets. Choose all of the tables and Load.

Figure 1003 Choose to load data from each Table in the workbook.

After loading the data, you are returned to a blank canvas. It is a bit disconcerting that 95% of the screen remains unchanged. Move your eyes to the far right of the screen and notice that your tables are now available in the Field list.