Beginning power BI a practical guide to self service data analytics with excel 2016 and power BI desktop

353 71 0
Beginning power BI  a practical guide to self service data analytics with excel 2016 and power BI desktop

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Beginning Power BI A Practical Guide to Self-Service Data Analytics with Excel 2016 and Power BI Desktop — Second Edition — Dan Clark Beginning Power BI A Practical Guide to Self-Service Data Analytics with Excel 2016 and Power BI Desktop Second Edition Dan Clark Beginning Power BI: A Practical Guide to Self-Service Data Analytics with Excel 2016 and Power BI Desktop Dan Clark Camp Hill, Pennsylvania, USA ISBN-13 (pbk): 978-1-4842-2576-9 DOI 10.1007/978-1-4842-2577-6 ISBN-13 (electronic): 978-1-4842-2577-6 Library of Congress Control Number: 2017934876 Copyright © 2017 by Dan Clark This work is subject to copyright All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed Trademarked names, logos, and images may appear in this book Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made The publisher makes no warranty, express or implied, with respect to the material contained herein Managing Director: Welmoed Spahr Editorial Director: Todd Green Acquisitions Editor: Gwenan Spearing Development Editor: Laura Berendson Technical Reviewer: Massimo Nardone Coordinating Editor: Nancy Chen Copy Editor: Corbin Collins Compositor: SPi Global Indexer: SPi Global Artist: SPi Global Cover image designed by FreePik Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring Street, 6th Floor, New York, NY 10013 Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-sbm.com, or visit www.springeronline.com Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc) SSBM Finance Inc is a Delaware corporation For information on translations, please e-mail rights@apress.com, or visit http://www.apress.com/ rights-permissions Apress titles may be purchased in bulk for academic, corporate, or promotional use eBook versions and licenses are also available for most titles For more information, reference our Print and eBook Bulk Sales web page at www.apress.com/bulk-sales Any source code or other supplementary material referenced by the author in this book is available to readers on GitHub via the book’s product page, located at www.apress.com/9781484225769 For more detailed information, please visit http://www.apress.com/source-code Printed on acid-free paper Contents at a Glance About the Author����������������������������������������������������������������������������������������������������� xi About the Technical Reviewer������������������������������������������������������������������������������� xiii Acknowledgments���������������������������������������������������������������������������������������������������xv Introduction�����������������������������������������������������������������������������������������������������������xvii ■Part ■ I: Building Models in Power Pivot����������������������������������������������� ■Chapter ■ 1: Introducing Power Pivot���������������������������������������������������������������������� ■Chapter ■ 2: Importing Data into Power Pivot�������������������������������������������������������� 19 ■Chapter ■ 3: Data Munging with Power Query������������������������������������������������������� 55 ■Chapter ■ 4: Creating the Data Model�������������������������������������������������������������������� 77 ■Chapter ■ 5: Creating Calculations with DAX������������������������������������������������������� 101 ■Chapter ■ 6: Creating Measures with DAX����������������������������������������������������������� 119 ■Chapter ■ 7: Incorporating Time Intelligence������������������������������������������������������� 145 ■Chapter ■ 8: Data Analysis with Pivot Tables and Charts������������������������������������� 165 ■■Part II: Building Interactive Reports and Dashboards with Power BI Desktop��������������������������������������������������������������������������� 191 ■Chapter ■ 9: Introducing Power BI Desktop��������������������������������������������������������� 193 ■Chapter ■ 10: Creating Reports with Power BI Desktop��������������������������������������� 217 ■■Chapter 11: Publishing Reports and Creating Dashboards in the Power BI Portal����������������������������������������������������������������������������������������������������251 iii ■ Contents at a Glance ■Chapter ■ 12: Creating a Complete Solution��������������������������������������������������������� 283 ■Chapter ■ 13: Advanced Topics in Power Query��������������������������������������������������� 301 ■Chapter ■ 14: Advanced Topics in Power BI��������������������������������������������������������� 319 Index��������������������������������������������������������������������������������������������������������������������� 343 iv Contents About the Author����������������������������������������������������������������������������������������������������� xi About the Technical Reviewer������������������������������������������������������������������������������� xiii Acknowledgments���������������������������������������������������������������������������������������������������xv Introduction�����������������������������������������������������������������������������������������������������������xvii ■Part ■ I: Building Models in Power Pivot����������������������������������������������� ■Chapter ■ 1: Introducing Power Pivot���������������������������������������������������������������������� Why Use Power Pivot?������������������������������������������������������������������������������������������������������ The xVelocity In-memory Analytics Engine���������������������������������������������������������������������� Enabling Power Pivot for Excel����������������������������������������������������������������������������������������� Exploring the Data Model Manager Interface������������������������������������������������������������������� Summary������������������������������������������������������������������������������������������������������������������������ 18 ■Chapter ■ 2: Importing Data into Power Pivot�������������������������������������������������������� 19 Importing Data from Relational Databases�������������������������������������������������������������������� 19 Importing Data from Text Files��������������������������������������������������������������������������������������� 34 Importing Data from a Data Feed����������������������������������������������������������������������������������� 39 Importing Data from an OLAP Cube�������������������������������������������������������������������������������� 41 Reusing Existing Connections to Update the Model������������������������������������������������������� 43 Summary������������������������������������������������������������������������������������������������������������������������ 54 ■Chapter ■ 3: Data Munging with Power Query������������������������������������������������������� 55 Discovering and Importing Data������������������������������������������������������������������������������������� 55 Transforming, Cleansing, and Filtering Data������������������������������������������������������������������� 58 Merging and Shaping Data��������������������������������������������������������������������������������������������� 61 v ■ Contents Grouping and Aggregating Data������������������������������������������������������������������������������������� 65 Inserting Calculated Columns���������������������������������������������������������������������������������������� 67 Summary������������������������������������������������������������������������������������������������������������������������ 75 ■Chapter ■ 4: Creating the Data Model�������������������������������������������������������������������� 77 What Is a Data Model?��������������������������������������������������������������������������������������������������� 77 Creating Table Relations������������������������������������������������������������������������������������������������� 79 Creating a Star Schema������������������������������������������������������������������������������������������������� 83 Understanding When to Denormalize the Data��������������������������������������������������������������� 85 Creating Linked Tables��������������������������������������������������������������������������������������������������� 86 Creating Hierarchies������������������������������������������������������������������������������������������������������� 88 Making a User-Friendly Model��������������������������������������������������������������������������������������� 88 Summary������������������������������������������������������������������������������������������������������������������������ 99 ■Chapter ■ 5: Creating Calculations with DAX������������������������������������������������������� 101 What Is DAX?���������������������������������������������������������������������������������������������������������������� 101 Implementing DAX Operators��������������������������������������������������������������������������������������� 103 Working with Text Functions���������������������������������������������������������������������������������������� 105 Using DAX Date and Time Functions���������������������������������������������������������������������������� 107 Using Informational and Logical Functions������������������������������������������������������������������ 108 Getting Data from Related Tables��������������������������������������������������������������������������������� 109 Using Math, Trig, and Statistical Functions������������������������������������������������������������������ 110 Tips for Creating Calculations in Power Pivot�������������������������������������������������������������� 112 Summary���������������������������������������������������������������������������������������������������������������������� 117 ■Chapter ■ 6: Creating Measures with DAX����������������������������������������������������������� 119 Measures vs Attributes������������������������������������������������������������������������������������������������ 119 Creating Common Aggregates�������������������������������������������������������������������������������������� 121 Mastering Data Context������������������������������������������������������������������������������������������������ 124 Altering the Query Context������������������������������������������������������������������������������������������� 125 vi ■ Contents Using Filter Functions�������������������������������������������������������������������������������������������������� 127 Creating KPIs���������������������������������������������������������������������������������������������������������������� 132 Summary���������������������������������������������������������������������������������������������������������������������� 143 ■Chapter ■ 7: Incorporating Time Intelligence������������������������������������������������������� 145 Date-Based Analysis���������������������������������������������������������������������������������������������������� 145 Creating a Date Table��������������������������������������������������������������������������������������������������� 147 Time Period–Based Evaluations����������������������������������������������������������������������������������� 150 Shifting the Date Context��������������������������������������������������������������������������������������������� 151 Using Single Date Functions���������������������������������������������������������������������������������������� 155 Creating Semi-Additive Measures�������������������������������������������������������������������������������� 156 Summary���������������������������������������������������������������������������������������������������������������������� 164 ■Chapter ■ 8: Data Analysis with Pivot Tables and Charts������������������������������������� 165 Pivot Table Fundamentals�������������������������������������������������������������������������������������������� 165 Slicing the Data������������������������������������������������������������������������������������������������������������ 168 Adding Visualizations to a Pivot Table�������������������������������������������������������������������������� 170 Working with Pivot Charts ������������������������������������������������������������������������������������������� 174 Using Multiple Charts and Tables��������������������������������������������������������������������������������� 178 Using Cube Functions �������������������������������������������������������������������������������������������������� 180 Summary���������������������������������������������������������������������������������������������������������������������� 189 ■■Part II: Building Interactive Reports and Dashboards with Power BI Desktop��������������������������������������������������������������������������� 191 ■Chapter ■ 9: Introducing Power BI Desktop��������������������������������������������������������� 193 Setting Up the Power BI Environment�������������������������������������������������������������������������� 193 Getting, Cleaning, and Shaping Data���������������������������������������������������������������������������� 196 Creating Table Relationships���������������������������������������������������������������������������������������� 202 Adding Calculations and Measures������������������������������������������������������������������������������ 207 Incorporating Time-based Analysis������������������������������������������������������������������������������ 210 Summary���������������������������������������������������������������������������������������������������������������������� 216 vii ■ Contents ■Chapter ■ 10: Creating Reports with Power BI Desktop��������������������������������������� 217 Creating Tables and Matrices��������������������������������������������������������������������������������������� 217 Constructing Bar, Column, and Pie Charts�������������������������������������������������������������������� 222 Building Line and Scatter Charts���������������������������������������������������������������������������������� 229 Creating Map-Based Visualizations������������������������������������������������������������������������������ 234 Linking Visualizations in Power BI�������������������������������������������������������������������������������� 239 Drilling Through Visualizations������������������������������������������������������������������������������������� 243 Summary���������������������������������������������������������������������������������������������������������������������� 249 ■■Chapter 11: Publishing Reports and Creating Dashboards in the Power BI Portal����������������������������������������������������������������������������������������������������251 Creating a User-Friendly Model������������������������������������������������������������������������������������ 251 Publishing Power BI Desktop Files to the Power BI Service���������������������������������������� 254 Adding Tiles to a Dashboard����������������������������������������������������������������������������������������� 257 Sharing Dashboards����������������������������������������������������������������������������������������������������� 262 Refreshing Data in Published Reports�������������������������������������������������������������������������� 266 Summary���������������������������������������������������������������������������������������������������������������������� 281 ■Chapter ■ 12: Creating a Complete Solution��������������������������������������������������������� 283 Use Case 1: Reseller Sales Analysis����������������������������������������������������������������������������� 283 Load the Data������������������������������������������������������������������������������������������������������������������������������������� 283 Create the Model�������������������������������������������������������������������������������������������������������������������������������� 284 Create Calculated Columns���������������������������������������������������������������������������������������������������������������� 286 Create Measures�������������������������������������������������������������������������������������������������������������������������������� 286 Create the Dashboard������������������������������������������������������������������������������������������������������������������������� 288 Use Case 2: Sales Quota Analysis�������������������������������������������������������������������������������� 290 Load the Data������������������������������������������������������������������������������������������������������������������������������������� 290 Create the Model�������������������������������������������������������������������������������������������������������������������������������� 294 Create Measures�������������������������������������������������������������������������������������������������������������������������������� 295 Create the Report������������������������������������������������������������������������������������������������������������������������������� 296 viii ■ Contents Use Case 3: Sensor Analysis���������������������������������������������������������������������������������������� 297 Load the Data������������������������������������������������������������������������������������������������������������������������������������� 298 Summary���������������������������������������������������������������������������������������������������������������������� 300 ■Chapter ■ 13: Advanced Topics in Power Query��������������������������������������������������� 301 Writing Queries with M������������������������������������������������������������������������������������������������� 301 Creating and Using Parameters������������������������������������������������������������������������������������ 304 Creating and Using Functions�������������������������������������������������������������������������������������� 309 Summary���������������������������������������������������������������������������������������������������������������������� 318 ■Chapter ■ 14: Advanced Topics in Power BI��������������������������������������������������������� 319 Using Custom Visuals��������������������������������������������������������������������������������������������������� 319 Implementing Geo-spatial Analysis������������������������������������������������������������������������������ 323 Implementing Row-Based Security������������������������������������������������������������������������������ 328 Creating Templates and Content Packs������������������������������������������������������������������������ 330 Summary���������������������������������������������������������������������������������������������������������������������� 342 Index��������������������������������������������������������������������������������������������������������������������� 343 ix Chapter 14 ■ Advanced Topics in Power BI In the Create Content Pack window, choose whether you want to publish it to the organization or to specific groups If you select specific groups, enter the emails of the groups Add a title and description for the content pack You can also add a logo for it (see Figure 14-17) Figure 14-17.  Adding a title and description to a content pack 334 Chapter 14 ■ Advanced Topics in Power BI Next, select the items you want to include in the content pack (see Figure 14-18) Figure 14-18.  Choosing items to include in the content pack 335 Chapter 14 ■ Advanced Topics in Power BI Once the content pack is published, members of the group can import the content pack by clicking the Get Data link in the navigation pane and then selecting the My organization tab (see Figure 14-19) Figure 14-19.  Importing an organizational content pack In addition to your organizational content packs, many app-based content packs are available (see Figure 14-20) For example, there are content packs for Salesforce, CRM, and Azure Audit Logs These allow you to get up and running quickly and deploy dashboards related to the service 336 Chapter 14 ■ Advanced Topics in Power BI Figure 14-20.  Selecting an app-based content pack ■■Note  To create content packs, you need to have a Power BI Pro license Now that you are familiar with some advanced features of Power BI, you are ready to gain some handson experience with these features in the following lab HANDS-ON LAB: ADVANCED TOPICS IN POWER BI In the following lab you will • Use some custom visuals • Implement row-level security • Create a Power BI template In the LabStarterFiles\Chapter14Lab1 folder, open the CustomVisuals.pbix file This file contains data on sales and quotas for sales reps In the LabStarterFiles\Chapter14Lab1 folder, there is a Visuals folder that contains several custom visual pbviz files Add these visuals to the Visualizations toolbox in Power BI Desktop After importing the visuals, you should see the new icons in the toolbox (see Figure 14-21) 337 Chapter 14 ■ Advanced Topics in Power BI Figure 14-21.  Adding custom visuals to the toolbox Add the following visuals and fields to the wells, as indicated in Table 14-1 Table 14-1.  Adding Visuals and Fields to the Wells Visual Well Fields HierarchySlicer Fields Period.Year CardWithStates Field Sales.TotalSales State Value Sales.TotalSales State Max Quota.NinetyPercentQuota State Min Quota.NinetyPercentQuota State Max Quota.Quota State Min Quota.Quota State Max Quota.MaxQuota Categort Rep.LastName Value Sales.TotalSales TargetValue Quota.Quota Minimum Quota.SeventyPercentQuota Satisfactory Quota.NinetyPercentQuota VeryGood Quota.Quota Period.Quarter BulletChart 338 Chapter 14 ■ Advanced Topics in Power BI The final report page should be similar to Figure 14-22 Investigate the different formatting available in the visuals Figure 14-22.  Report, Page 1, with custom visuals Add a second page to the report and add the visuals and fields to the wells as shown in Table 14-2 Table 14-2.  Adding Page Visuals and Fields to the Wells Visual Well Fields Tornado Group Territory.Region Values Sales.Sales2015Q1 Sales.Sales2016Q1 GapAnalysis Statement GapAnalysis.Region Groups to Compare GapAnalysis.TimePeriod Values GapAnalysis.SalesAmount 339 Chapter 14 ■ Advanced Topics in Power BI The final report page should be similar to Figure 14-23 Take some time to investigate the different formatting available in the visuals Close and save the file when finished Figure 14-23.  Report, Page 2, with custom visuals In the LabStarterFiles\Chapter14Lab1 folder, open the RowLevelSecurity.pbix file On the Modeling tab, select Manage Roles Add the NorthAmericanSales, PacificSales, and EuropeanSales roles Using a DAX filter, restrict the territories they can see Figure 14-24 shows the DAX filter for the PacificSales role 340 Chapter 14 ■ Advanced Topics in Power BI Figure 14-24.  Setting role-based filters 10 Test the filter by selecting the View As Roles If you view Page of the report as the EuropeanSales role, you should only see France, Germany, and United Kingdom data (see Figure 14-25) Figure 14-25.  Testing the EuropeanSales role 341 Chapter 14 ■ Advanced Topics in Power BI 11 Once done testing the roles, save the file On the File tab, click Export and export the file as a Power BI Template file Add a template description and save the file as TemplateDemo.pbit 12 Close Power BI Desktop and double-click the template file This should launch Power BI Desktop and ask you for the folder path Provide the path to the data folder and click Load 13 After the data loads, save the file as TemplateDemo.pbix 14 Close Power BI Desktop and compare the size of the template file with the original pbix file The template file doesn’t contain data, so it should be much smaller Summary This chapter covered some advanced topics in Power BI, including using custom visuals, advanced mapping, row-based security, and templates As I mentioned at the end of Chapter 12, the goal of this book has been to expose you to the various tools in Microsoft’s self-service BI stack I hope you have gained enough confidence and experience with these tools to start using them to analyze and gain insight into your own data I also encourage you to take advantage of the many excellent resources available on the Internet Microsoft’s Power BI site (www microsoft.com/en-us/powerbi/default.aspx), Bill Jelen’s site (www.mrexcel.com), and Rob Collie’s Power Pivot Pro site (www.powerpivotpro.com) are excellent resources For more advanced topics, check out Chris Webb’s BI Blog at https://blog.crossjoin.co.uk/ and Marco Russo’s and Alberto Ferrari’s SQLBI site at www.sqlbi.com 342 Index „„         A „„         D Aggregate data, 65–66 ALL function, 126–127 AllProductSales measure, 126 Appending queries, 63 ArcGIS map, 327 AutoSum drop-down, 136 Dashboards on Power BI Portal create daily refresh, 280 create new dashboard, 274 display dataset menu, 278 edit data source, 280 final dashboard, 280 open report, 273 Q&A to create table, 275 sample sales report, 271 schedule data refresh, 281 sign in to Power BI Service, 272 tile details, edit, 276 tile menu, display, 275 reseller sales final in Excel worksheet, 290 max reseller sales, 288–289 report, 288 sharing, 262–265 tiles complete, 262 media, 261 pin visuals, 258 Q&A screen, 259–260 rearrange and resize, 262 view, 259 Data Analysis Expressions (DAX) calculations, 101 cells in different rows, 103 common aggregates auto sum, 122 calculated columns, 124 edit measure formula, 123 fact table, 121 finance table, 122 measure grid, 122 organizing measures, 123 resulting measure below column, 123 „„         B Boolean expressions, 126, 131 „„         C CALCULATE function, 128, 138 Calendar function, 210 Charts, pivot table creation, 176 data source, 174 selection, 174, 177 workbook data model, 175 Comma-separated value (CSV) format, 34 Composite key, 79 Content packs, 330, 332, 334–337 CSV file, 198–199 Cube functions power pivot data model, 180–181 rearranging data, 182 to retrieve values, 181–182 Custom visuals add, 321, 338 available, 320 demo file, 322 download, 320 report page, 339–340 synoptic panel, 322 wells, 338–339 © Dan Clark 2017 D Clark, Beginning Power BI, DOI 10.1007/978-1-4842-2577-6 343 ■ INDEX Data Analysis Expressions (DAX) (cont.) data types, 103 date and time functions, 107–108 defined, 101 Excel values, 101–102 filter functions Boolean expression, 131 changing date, 131 employee counts, departments, 130 KPI see Key Performance Indicator (KPI) MAX function, 132 Power Pivot model, 127–128 resulting measures, pivot table, 129 sales amount measures, 129 sales reps count, 128 single order customers, 129 informational and logical functions, 108–109 mastering data context, 124–125 math, trig and statistical functions, 110–112 measures vs attributes, 119–121 numeric data type with text data type, 103 operators, 104–105 Power Pivot model, 102, 112–116 query context, 125–126 tables and columns, 103 text functions, 105–107 working, 103 Data analysis, pivot tables and charts BI interface in Excel, creating AdventureWorksDW database, 182 column chart, formatting/selection, 185 conditional formatting, 183 dashboard creation, 188–189 data bars, pivot table, 184 sales pie chart creation, 186 selecting connection, 183 slicers, inserting, 187 cube functions, 180–182 data slicing, 168–170 multiple charts and tables, 178–179 pivot charts, 174–177 pivot table fundamentals, 165, 167 visualizations, 170–173 Data context, 124–125 Data discovery, Power Query discovering and importing data data sources, 56 navigator pane, 57–58 new Power Query tab, 55 Query Editor window, 57 SSIS, 55 grouping and aggregating data, 65–66 importing and shaping data by origin and carrier, 73 Query Editor window, 70 344 from two queries, 73–74 workbook queries, 71 inserting calculated columns creating using M formulas, 67–68 DAX formulas, 69 displaying results of query, 68 query with M, 67 merging and shaping data appending queries, 63 columns selection, 63, 64 in Power Pivot model, 61 resulting rows from unpivot transformation, 65, 337 spliting column, using delimiter, 63–64 from two queries, 61–62 using matrix, 64 transforming, cleansing, and filtering data data type, column, 59 filtering rows, 60 managing query steps, 61 replacing values, column, 60 Data model connection, selection, 161 customer, 77, 78 database tables, 79 defined, 77 denormalization, 85–86 hierarchies, 88 linked table data, 98 linked tables, 86–87 normalization, 78 normalized and non-normalized table, 78 power pivot, 89–90, 92–96, 98 primary key, 78 ProductKey and update the column names, 96 Quick Analysis Tables tab, 98 relationship, 97–98 running the query, 94 Sales Territory hierarchy, 99 star schema, 83–84 surrogate key and a natural key, 79 table relations, 79–83, 92 time stamp to track changes, 78 traditional Excel pivot tables, 77 user-friendly model, 88–89 Data Model Manager calculated column, 10 diagram view, 12 Excel interface, 8, exploring Power Pivot, 13 exploring relationships, 17 grid area measurement, 11 hierarchy, 16, 18 Home menu tab, 11 launching, ■ INDEX pivot table, 13, 14 slicer fields selection, 15 slicers to filter, 16 Data model, Power BI Desktop date table, 215 enable load option, 214 filter data, 212 merging queries, 213 Query Editor, 211–212 SF311Calls table, 216 Data refresh, 266–270 Data source, 56–58, 64, 269 Date and time functions, 107–108 Date-based analysis, 145 aggregating inventory amounts, 147 sales growth, calculation, 146 year-to-date and month-to-date sales, calculation, 146 Date context, shifting, 151 DATEADD function, 154 month level aggregation, 153 sales for a parallel period, calculation, 152 year over year monthly growth, calculation, 154 Date table custom calculations, 149 DAX query engine, 148 identification, 149 relationship between sales, 159 setting the date key, 149 from values, 158 DAX code, 17 DAX formulas, 69 Delimiter, split column, 64, 201 DrillType, 316 „„         E Enterprise resource planning (ERP) system, 34 Error information, 113 Error message, 114 Excel defined, 193 formulas, 101–102 pivot tables, 77 Power Pivot Account tab, add-in, 7, edition and version, Excel version, External data source, choosing, 160 „„         F Filled map, 325 Filter context, 125, 209 FILTER function, 132 Filtering rows, 60 FIND function, 106 Foreign key, 79 FORMAT function, 106 Functions, school year custom column, 311 drill data, 312–313 group data, 313 look-up table, 309 testing, 313 „„         G, H Geo-spatial analysis ArcGIS Map, 327 filled map, 325 sales by city, 323 shape map, 326 Group data, 65–66 „„         I, J IFERROR function, 109 IF statement, 105 Importing data data feed, 39–40 OLAP Cube, 41–43 relational databases, 19–21, 23–26, 28–33 text files, 34–38 Informational functions, DAX, 109 Inventory measure, testing, 164 ISBLANK function, 108 ISERROR function, 108–109 „„         K Key Performance Indicator (KPI) comparison current to previous sales, 133 creating measures AutoSum drop-down, 136 average sales KPI, 142–143 inactive relationship, 139 pivot table, 136 Power Pivot model, 135 slicer, 137 store count measure, testing, 140 testing measure, 138 testing query context, 138 Top Sale Day measure, 141 for current sales, 132 design window, 133–134 in performance dashboards, 132 pivot table in Excel, 134 345 ■ INDEX „„         L Linked tables, 86–87 Logical functions, DAX, 109 „„         M Map ArcGIS, 327 filled, 325 shape, 326 Math functions, 110–111 MAX function, 132 MDX query, 43 Media tiles, 261 Merging data, 61–65 Merging queries, 95 M formulas, 67–68 Microsoft’s self-service business intelligence (BI) toolset, M query applied steps, 302 functions, 303 view, 301 Multidimensional Expressions (MDX), Multiple charts and tables connecting multiple pivot charts, 179 pivot chart selection, 178 simple dashboard creation, Excel, 179 „„         N Natural key, 79 Navigator pane, 58 Non-normalized table, 78 Normalizing, 78 „„         O Online analytical processing (OLAP) database, 3, 84 Operators, DAX, 104–105 „„         P Parameters defined, 305 edit, 308 Excel sheets, 308 list of values for, 306 new, 304 ProjectCode, 308 query editor, 308 setting values, 307 346 Pivot table fundamentals data slicing, 167 field selection, 166 parts, 166 Power BI desktop building line and scatter charts, 229, 231–233 calculated columns, 208–209 constructing bar, column and pie charts adding reference lines, 227 bar chart comparing sales, 223 change sorting, 228 clustered column chart, 225 column chart comparing sales, 223 comparing data, pie chart, 229 legend layout and data colors, 226 stacked column chart, 224 content packs, 330, 332, 334–337 creating tables and matrices customer contact information, 219 filtering, table, 220 formatted table, 221 quarter and reseller type, 222 table formatting options, 220–221 visualization toolbox, 218 custom visuals, 319–322 data button, 256 data category, 253 data model, 211–216 data sources, 197 data view, 252 drilling through visualizations, 243 geo-spatial analysis, 323–327 home tab, 196 linking visualizations, 239, 241–243 map-based visualizations, 234–235, 237–238 measures, 209 neighborhood field, 248–249 parameters, 304 publish Power BI Service, 254–257 row-based security, 328–330 settings download, 194 options, 195 stacked bar chart, 245 star schema, 203 table cardinality, 205 customer, 206 dimension, 203 edit, 205 fact, 203 filter across multiple, 207 finance table, 203 relationships, 203–204 sales, 206 ■ INDEX templates, 330, 332, 334–337 time-based analysis, 210 tree map, 246 turning off filtering, 246 Power BI Pro license, 264, 337 Power BI Service, 272, 330, 332 publish Power BI Desktop, 254–257 selecting file location, 257 share dashboards, 262 Power Pivot model, 3, 79, 85–86, 88–89, 91, 93–96, 98, 101, 102, 112–116, 121, 124 access database, 48 admirable goals, benefits, connection to database, 23 data context, 124 data feed, 39–40 Data Model Manager interface, 8–11, 13–18 data sources, 19, 22, 54 data steward committee reviews, data view window, 51 Excel, 5–8 existing connection opening, 44 existing connections selection, 43 filtering rows, 28 filtering table columns, 50 filtering table rows, 51 importing the data, 29 inactive relationship, 128 interface, 3, 193 loading data, 46 many-to-many relationship, 20 model designer window, 47 OLAP cube, 41–43 one-off data analysis projects, OrderDetailQuery.txt, 52 own query creation, 31 previewing and filtering, 27 ProductID, 19 ProductList.txt file, 52–53 query designer, 32 query in Query Editor mode, 46 query in Table Preview mode, 45 RDMS, 19 for reseller sales, 127 retrieve the data, 24 running the query and viewing, 33 select tables and views window, 48–49 setting up a connection, 21 SharePoint, table import wizard, 47 table properties, 45 table relationships, 30 tables and views selection, 26 tables to customer address, 25 text files, 34–38 traditional BI project, viewing and validating the query, 34 window design, 135 xVelocity in-memory analytics engine, Power Query, 55–56, 65–67, 69–74, 78, 93–94, 193, 196 advanced query building with, 313, 315, 317–318 functions, 309, 313 M query, 301–303 parameters, 304, 307–308 Power Query Editor, 198–202 Primary key, 78–79 Product table, 83–84 ProjectCode, 308 Publish reports, 266–270 „„         Q Query context, 124–126, 138 Query Editor, 61, 63, 65, 67, 308 Query Editor window, 57, 61, 69–70 Quick Analysis Tables tab, 98 „„         R Refreshing data, 266–270 RELATED function, 109–110 Relational database, importing data, 19–21, 23–33 Relational database management systems (RDMS), 19 Remove columns, 60 Reseller sales analysis dashboard, 288–290 date column, 286 DAX RELATED function, 286 filtered measures, 288 pivot table, 286 properties, 285 tables and columns to import, 284 test measurement, 287 Row-based security DAX, 328–329 secure data, 330 Row context, 124, 209 „„         S Sales amount measures, 129 Sales quota analysis dashboard, 290 disable load option, 292 final quotas query data, 292 final sales query data, 291 347 ■ INDEX Sales quota analysis (cont.) Period query, 293 property settings, 294 quota table, 295 relationships, 294–295 report, 296–297 sales team, 290 tables and columns to import, 291 Sales table, 83 Semi-additive measures, creation contoso data model, 158 DAX, 156, 157 inventory and account balances, 156 units in stock across products, 156–157 Sensor analysis aggregate and group alarm data, 299–300 Alarms query, 298–299 AlarmType query, 298 latitude and longitude, 299 power and voltage, 297 Shape map, 326 Shaping data, 61–65 Single date functions, 155–156 Single-order customers, 129 Slicing, data cascading filters, creation, 170 changing settings, 170 selection, power pivot data model, 168 slicer connections, 169 SQL Server Analysis Server (SSAS), SQL Server Integration Services (SSIS), 55 Star schema, 83–85, 120–121, 203 Statistical functions, 111 Store table, 84 SUM function, 126 SUMX function, 123 Surrogate key, 79, 88 348 „„         T, U Templates, 330, 332, 334–337 Text functions, DAX, 105–107 Time intelligence, incorporating date-based analysis, 145–147 date table, creating, 147–149 implementation, hands on lab, 158 semi-additive measures, creating, 156–164 shifting the date context, 151, 153–154 time period–based evaluations, 150–151 using single date functions, 155–156 Time period–based evaluations, 150–151 Trig functions, 111 „„         V Visualizations, pivot table conditional formatting and databars, 171 editing data bar rule, 172 heat map creation, conditional formatting, 173 spark lines, creation, 173 „„         W Workbook queries, 71–72 „„         X X functions, 123 xVelocity in-memory analytics engine, „„         Y, Z Year-to-date sales measure, verification, 162 .. .Beginning Power BI A Practical Guide to Self- Service Data Analytics with Excel 2016 and Power BI Desktop Second Edition Dan Clark Beginning Power BI: A Practical Guide to Self- Service Data Analytics. .. silos of data, clean the company data and make sure it conforms to standards, and provide insight into data trends through dashboards Although these are admirable goals and are great reasons to provide... Pivot to provide fast performance on large amounts of data One of the keys to this is it uses a columnar database to store the data Traditional row-based data storage stores all the data in the

Ngày đăng: 25/08/2021, 16:35

Từ khóa liên quan

Mục lục

  • Contents at a Glance

  • Contents

  • About the Author

  • About the Technical Reviewer

  • Acknowledgments

  • Introduction

  • Part I: Building Models in Power Pivot

    • Chapter 1: Introducing Power Pivot

      • Why Use Power Pivot?

      • The xVelocity In-memory Analytics Engine

      • Enabling Power Pivot for Excel

      • Exploring the Data Model Manager Interface

      • Summary

      • Chapter 2: Importing Data into Power Pivot

        • Importing Data from Relational Databases

        • Importing Data from Text Files

        • Importing Data from a Data Feed

        • Importing Data from an OLAP Cube

        • Reusing Existing Connections to Update the Model

        • Summary

        • Chapter 3: Data Munging with Power Query

          • Discovering and Importing Data

          • Transforming, Cleansing, and Filtering Data

          • Merging and Shaping Data

Tài liệu cùng người dùng

Tài liệu liên quan