Tải bản đầy đủ (.pdf) (618 trang)

High Impact Data Visualization in Excel with Power View, 3D Maps, Get Transform and Power BI

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (29.73 MB, 618 trang )

High Impact Data
Visualization in Excel
with Power View,
3D Maps, Get &
Transform and
Power BI
Going from data to insight with Power BI
and Microsoft’s self-service BI tool set

Second Edition

Adam Aspin

www.allitebooks.com


High Impact Data
Visualization in Excel
with Power View, 3D
Maps, Get & Transform
and Power BI
Second Edition

Adam Aspin

www.allitebooks.com


High Impact Data Visualization in Excel with Power View, 3D Maps, Get & Transform and Power BI

Adam Aspin


Stafford
United Kingdom
ISBN-13 (pbk): 978-1-4842-2399-4
DOI 10.1007/978-1-4842-2400-7

ISBN-13 (electronic): 978-1-4842-2400-7

Library of Congress Control Number: 2016959188
Copyright © 2016 by Adam Aspin
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
Lead Editor: Jonathan Gennick
Development Editor: Laura Berendson
Editorial Board: Steve Anglin, Pramila Balan, Laura Berendson, Aaron Black, Louise Corrigan,
Jonathan Gennick, Todd Green, Robert Hutchinson, Celestin Suresh John, Nikhil Karkal,

James Markham, Susan McDermott, Matthew Moodie, Natalie Pao, Gwenan Spearing
Coordinating Editor: Jill Balzano
Copy Editor: Kim Wimpsett
Compositor: SPi Global
Indexer: SPi Global
Artist: SPi Global
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 ,
or visit www.springer.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 , or visit www.apress.com.
Apress and friends of ED books 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 Special
Bulk Sales–eBook Licensing web page at www.apress.com/bulk-sales.
Any source code or other supplementary materials referenced by the author in this text are available to
readers at www.apress.com. For detailed information about how to locate your book’s source code, go to
www.apress.com/source-code/. Readers can also access source code at SpringerLink in the Supplementary
Material section for each chapter.
Printed on acid-free paper

www.allitebooks.com


For Hannah

www.allitebooks.com


Contents at a Glance
About the Author .................................................................................................xxvii

Acknowledgments ................................................................................................xxix
Introduction ..........................................................................................................xxxi
■Chapter 1: Self-Service Business Intelligence with Excel 2016 ............................ 1
■Chapter 2: Power View and Tables ...................................................................... 17
■Chapter 3: Filtering Data in Power View ............................................................. 57
■Chapter 4: Charts in Power View ........................................................................ 87
■Chapter 5: Advanced Charting with Power View ............................................... 121
■Chapter 6: Interactive Data Selection in Power View ........................................ 143
■Chapter 7: Images and Presentation in Power View ......................................... 175
■Chapter 8: Mapping Data in Power View ........................................................... 205
■Chapter 9: 3D Maps ........................................................................................... 225
■ Chapter 10: Discovering and Loading Data with Get & Transform
in Excel 2016 ..................................................................................................... 279
■Chapter 11: Transforming Data Sets Using Get & Transform ............................. 321
■Chapter 12: Data Cleansing with Get & Transform ............................................ 349
■Chapter 13: Data Mashup with Get & Transform ............................................... 371
■Chapter 14: Extending the Excel Data Model Using Power Pivot....................... 411
■Chapter 15: Extending the Data Model with Calculated Columns ..................... 463

v

www.allitebooks.com


■ CONTENTS AT A GLANCE

■Chapter 16: Adding Measures to the Data Model .............................................. 495
■Chapter 17: Analyzing Data over Time with DAX ............................................... 529
■Chapter 18: Self-Service Business Intelligence with PowerBI.com .................. 565
Index ..................................................................................................................... 591


vi

www.allitebooks.com


Contents
About the Author .................................................................................................xxvii
Acknowledgments ................................................................................................xxix
Introduction ..........................................................................................................xxxi
■Chapter 1: Self-Service Business Intelligence with Excel 2016 ............................ 1
The Excel BI Toolkit .......................................................................................................... 2
The Self-Service Business Intelligence Universe in Excel 2016 ............................................................. 2
Get and Transform .................................................................................................................................. 3
Power Pivot............................................................................................................................................. 3

Power View....................................................................................................................... 4
3D Maps.................................................................................................................................................. 5
The Power BI Service ............................................................................................................................. 5

Preparing the Excel BI Toolkit ........................................................................................... 5
Enabling the Excel BI Toolkit ................................................................................................................... 6
Power View ............................................................................................................................................. 8
Get and Transform ................................................................................................................................ 10
3D Maps................................................................................................................................................ 11

Corporate BI or Self-Service BI? .................................................................................... 11
The Excel Data Model ..................................................................................................... 12
How This Book Is Designed to Be Read .......................................................................... 13
Discovering Data .................................................................................................................................. 14

Creating a Data Model .......................................................................................................................... 14
Taking Data and Preparing It for Output ............................................................................................... 14
Delivering Geodata ............................................................................................................................... 14

vii

www.allitebooks.com


■ CONTENTS

Taking Existing Excel BI and Sharing It................................................................................................. 14
Delivering Excel BI to Mobile Devices................................................................................................... 14
Learning the Product Suite Following a Real-World Path ..................................................................... 15

Conclusion ...................................................................................................................... 15
■Chapter 2: Power View and Tables ...................................................................... 17
The Power View Experience ........................................................................................... 18
Adding a Power View Sheet to an Excel Workbook .............................................................................. 18
The Power View Interface ..................................................................................................................... 18
The Power View Ribbon ........................................................................................................................ 19
The Field List ........................................................................................................................................ 21
Using the Field List ............................................................................................................................... 21
Renaming or Deleting a Power View Report ......................................................................................... 23

Tables in Power View ..................................................................................................... 23
Adding a Table ...................................................................................................................................... 23
Deleting a Table .................................................................................................................................... 26
Changing the Table Size and Position ................................................................................................... 26
Changing Column Order........................................................................................................................ 27

Removing Columns from a Table .......................................................................................................... 27

Types of Data .................................................................................................................. 28
Data and Aggregations ................................................................................................... 29
Enhancing Tables ........................................................................................................... 30
The Design Ribbon................................................................................................................................ 30
Row Totals ............................................................................................................................................ 32
Formatting Columns of Numbers.......................................................................................................... 33
Default Formatting................................................................................................................................ 34
Changing Column Widths...................................................................................................................... 34
Font Sizes in Tables .............................................................................................................................. 36
Copying a Table..................................................................................................................................... 36
Sorting by Column ................................................................................................................................ 36

Table Granularity ............................................................................................................ 37

viii

www.allitebooks.com


■ CONTENTS

Matrix Tables .................................................................................................................. 38
Row Matrix ........................................................................................................................................... 38
Column Matrix ...................................................................................................................................... 40
Sorting Data in Matrix Tables................................................................................................................ 43

Drilling Through with Matrix Tables ................................................................................ 44
Drilling Down ........................................................................................................................................ 45

Drilling Up ............................................................................................................................................. 46
Reapplying Matrix Visualization ............................................................................................................ 47
Drilling Through with Column Hierarchies ............................................................................................ 47

Card Visualizations ......................................................................................................... 49
Card Visualization Styles ...................................................................................................................... 52
Sorting Data in Card-View Tables ......................................................................................................... 53

Switching Between Table Types ..................................................................................... 53
Key Performance Indicators .......................................................................................... 54
Creating Power View Reports and Tables Without a Data Model .................................... 54
Conclusion ...................................................................................................................... 55
■Chapter 3: Filtering Data in Power View ............................................................. 57
Filters ............................................................................................................................. 57
View Filters..................................................................................................................... 59
Adding Filters ....................................................................................................................................... 59
Using the (All) Filter .............................................................................................................................. 61
Clearing Filters ..................................................................................................................................... 61
Deleting Filters ..................................................................................................................................... 62
Expanding and Collapsing Filters ......................................................................................................... 62
Subsetting Large Filter Lists ................................................................................................................. 63

Filtering Different Data Types ......................................................................................... 66
Range Filter Mode ................................................................................................................................ 66
List Filter Mode ..................................................................................................................................... 68
Quickly Excluding Outliers .................................................................................................................... 69

ix

www.allitebooks.com



■ CONTENTS

Date and Time Data ........................................................................................................ 69
Other Data Types ............................................................................................................ 71
Multiple Filters ............................................................................................................... 71
Advanced Filters ............................................................................................................. 71
Applying an Advanced Filter ................................................................................................................. 72
Clearing an Advanced Filter .................................................................................................................. 73
Advanced Wildcard Filters .................................................................................................................... 74
Numeric Filters ..................................................................................................................................... 75

Date and Time Filters ..................................................................................................... 76
Complex Filters .............................................................................................................. 78
Advanced Text Filter Options ................................................................................................................ 79
Advanced Numeric Filter Options ......................................................................................................... 79
Advanced Date Filter Options ............................................................................................................... 80

Visualization-Level Filters .............................................................................................. 80
Filter Hierarchy ............................................................................................................... 81
Filtering Tips ................................................................................................................... 83
Don’t Filter Too Soon............................................................................................................................. 83
Drill-Down and Filters ........................................................................................................................... 84
Annotate, Annotate, Annotate................................................................................................................ 85

Conclusion ...................................................................................................................... 86
■Chapter 4: Charts in Power View ........................................................................ 87
A First Chart ................................................................................................................... 87
Deleting a Chart.............................................................................................................. 91

Basic Chart Modification ................................................................................................ 92
Basic Chart Types ........................................................................................................... 93
Column Charts ...................................................................................................................................... 93
Line Charts ........................................................................................................................................... 94
Pie Charts ............................................................................................................................................. 94
Essential Chart Adjustments ................................................................................................................. 96

x

www.allitebooks.com


■ CONTENTS

Resizing Charts .............................................................................................................. 96
Repositioning Charts ...................................................................................................... 97
Sorting Chart Elements .................................................................................................. 97
Font Size....................................................................................................................... 100
Applying Color to Bar and Column Charts .................................................................... 100
Multiple Data Values in Charts ..................................................................................... 101
The Layout Ribbon........................................................................................................ 105
Enhancing Charts ......................................................................................................... 106
Chart Legends .................................................................................................................................... 106
Chart Title ........................................................................................................................................... 107
Chart Data Labels ............................................................................................................................... 107

Drilling Down in Charts................................................................................................. 109
Popping Charts Out and In............................................................................................ 113
Chart Filters .................................................................................................................. 115
Conclusion .................................................................................................................... 119

■Chapter 5: Advanced Charting with Power View ............................................... 121
Multiple Charts ............................................................................................................. 121
Multiple Bar or Column Charts ........................................................................................................... 121
Specifying Vertical and Horizontal Selections .................................................................................... 123

Specifying the Layout of Multiple-Chart Visualizations ................................................ 124
Creating Horizontal Multiples ............................................................................................................. 124
Defining the Multiples Grid ................................................................................................................. 124
Multiple Line Charts............................................................................................................................ 126
Multiple Pie Charts ............................................................................................................................. 128
Drilling Down with Multiple Charts ..................................................................................................... 130

Scatter Charts .............................................................................................................. 131
Drilling Down with Scatter Charts ...................................................................................................... 132
Scatter Charts to Display Flattened Hierarchies ................................................................................. 133
Scatter Chart Multiples ....................................................................................................................... 134

xi


■ CONTENTS

Bubble Charts ............................................................................................................... 135
Bubble Chart Data Labels and Legend ............................................................................................... 137
Multiple Bubble Elements ................................................................................................................... 138
Bubble Chart Multiples ....................................................................................................................... 139

Play Axis ....................................................................................................................... 140
Conclusion .................................................................................................................... 142
■Chapter 6: Interactive Data Selection in Power View ........................................ 143

Tiles .............................................................................................................................. 144
Creating a Tiled Visualization from Scratch ........................................................................................ 144
Adjusting Tile Display ......................................................................................................................... 145

Some Variations on Ways of Creating Tiled Visualizations ........................................... 146
Creating a Tiled Visualization from Scratch—Another Variant ........................................................... 146
Adding Tiles to an Existing Visualization............................................................................................. 146
Adding Tiles to an Existing Visualization—Another Variant ................................................................ 147
Modifying an Existing Visualization Inside a Tile Container ................................................................ 147

Re-creating a Visualization Using Existing Tiles ........................................................... 148
Removing Tiles from a Visualization ............................................................................. 149
Deleting a Tile Visualization .......................................................................................... 149
Tile Types...................................................................................................................... 150
Using Tiles .................................................................................................................... 151
Filtering Tiles ................................................................................................................ 151
Tiles with No Data ........................................................................................................ 152
Changing the Inner Visualization .................................................................................. 153
Tiles and Multiple Charts .............................................................................................. 154
Slicers .......................................................................................................................... 154
Adding a Slicer ................................................................................................................................... 155
Applying a Slicer ................................................................................................................................. 156

Clearing a Slicer ........................................................................................................... 157
Deleting a Slicer ........................................................................................................... 157
xii


■ CONTENTS


Modifying a Slicer ........................................................................................................ 158
Using Charts as Slicers ............................................................................................... 158
Highlighting Chart Data ................................................................................................ 160
Cross-Chart Highlighting .............................................................................................. 161
Highlighting Data in Bubble Charts .............................................................................. 163
Charts as Filters ........................................................................................................... 165
Column and Bar Charts as Filters ....................................................................................................... 167
Choosing the Correct Approach to Interactive Data Selection ............................................................ 171

Filter Granularity........................................................................................................... 171
Conclusion .................................................................................................................... 174
■Chapter 7: Images and Presentation in Power View ......................................... 175
Titles ............................................................................................................................. 175
Adding a Title ...................................................................................................................................... 176
Moving and Resizing Titles ................................................................................................................. 176
Formatting a Title ............................................................................................................................... 177

The Text Ribbon ............................................................................................................ 177
Adding Text Boxes to Annotate a Report ...................................................................... 178
The Context Menu ........................................................................................................ 179
Altering the Font Used in a Report ............................................................................... 181
Changing the Text Size ................................................................................................. 182
Altering the Theme of a Report .................................................................................... 182
Deciphering Themes..................................................................................................... 185
Applying a Report Background ..................................................................................... 186
Images.......................................................................................................................... 189
Image Sources ............................................................................................................. 189
Background Images ..................................................................................................... 190
Adding a Background Image .............................................................................................................. 190
Fitting a Background Image ............................................................................................................... 191


xiii


■ CONTENTS

Removing a Background Image .......................................................................................................... 192
Setting an Image’s Transparency........................................................................................................ 193

Images in Tables........................................................................................................... 194
Images in Slicers .......................................................................................................... 195
Images in Tiles ............................................................................................................. 196
Independent Images ..................................................................................................... 197
Layering Visualizations ................................................................................................. 199
Some Uses for Independent Images ............................................................................ 200
Image File Format ........................................................................................................ 202
Conclusion ................................................................................................................... 203
■Chapter 8: Mapping Data in Power View ........................................................... 205
Bing Maps .................................................................................................................... 205
Maps in Power View ..................................................................................................... 206
Adjusting Map Display in Power View .......................................................................... 208
Positioning the Map Elements ............................................................................................................ 208
Zooming In or Out ............................................................................................................................... 209
Removing or Adding a Map Title ......................................................................................................... 209
Modifying the Map Background.......................................................................................................... 209

Filtering Map Data ........................................................................................................ 211
Multivalue Series .......................................................................................................... 212
Highlighting Map Data .................................................................................................. 214
Adjusting a Legend....................................................................................................... 216

Adding Tiles to Maps .................................................................................................... 217
Multiple Maps............................................................................................................... 218
Multiple Maps by Region .............................................................................................. 219
Drilling Down in Maps .................................................................................................. 221
Conclusion .................................................................................................................... 223

xiv


■ CONTENTS

■Chapter 9: 3D Maps ........................................................................................... 225
Bing Maps .................................................................................................................... 225
Running 3D Maps ......................................................................................................... 226
The 3D Maps Window ................................................................................................... 227
The 3D Maps Ribbon .................................................................................................... 228
Region Maps ................................................................................................................ 230
3D Maps Source Data ................................................................................................... 232
Refreshing Data .................................................................................................................................. 232
Geographical Data Types .................................................................................................................... 232

Using the Layer Pane ................................................................................................... 233
Showing and Hiding the Layer Pane ................................................................................................... 233
Layer Pane Elements .......................................................................................................................... 234

The Data Area ............................................................................................................... 234
Data Operations............................................................................................................ 235
Adding a Field ..................................................................................................................................... 236
Removing a Field ................................................................................................................................ 236


Moving Around in 3D Maps .......................................................................................... 236
Moving Around a Map ......................................................................................................................... 237
Zooming In or Out ............................................................................................................................... 237
Flat Map and 3D Globe ....................................................................................................................... 238
Adjusting the Pitch ............................................................................................................................. 238
Going to a Specific Location ............................................................................................................... 238

3D Maps Aggregations ................................................................................................. 239
Map Types .................................................................................................................... 239
The Various Map Types, by Example............................................................................. 240
Bubble Maps ....................................................................................................................................... 240
Column Maps ...................................................................................................................................... 244
Heat Maps .......................................................................................................................................... 247
Region Maps ....................................................................................................................................... 248

xv


■ CONTENTS

Presentation Options .................................................................................................... 250
The Settings View ............................................................................................................................... 250
Applying Specific Colors to Data Elements ......................................................................................... 254

3D Maps Themes .......................................................................................................... 255
Text Boxes .................................................................................................................... 256
Customizing the Data Card ........................................................................................... 257
Timelines ...................................................................................................................... 259
Adding a Timeline ............................................................................................................................... 259
Using a Timeline ................................................................................................................................. 261


Using Layers ................................................................................................................. 265
2D Charts ............................................................................................................................................ 268
2D Chart Types .................................................................................................................................... 269

3D Maps Tours .............................................................................................................. 269
Creating 3D Maps Tours...................................................................................................................... 270
Deleting a 3D Maps Tour ..................................................................................................................... 271
Existing 3D Maps Tours in Excel ......................................................................................................... 272

3D Maps Movies ........................................................................................................... 272
Scene Transitions ............................................................................................................................... 274
Managing Scenes ............................................................................................................................... 274
Exporting a Movie ............................................................................................................................... 275

Custom Regions ........................................................................................................... 277
Conclusion .................................................................................................................... 277
■ Chapter 10: Discovering and Loading Data with Get & Transform
in Excel 2016 ..................................................................................................... 279
Data Sources ................................................................................................................ 280
File Sources ........................................................................................................................................ 281
Databases ........................................................................................................................................... 281
Other Sources .................................................................................................................................... 283

xvi


■ CONTENTS

Loading Data ................................................................................................................ 285

Web Pages .......................................................................................................................................... 285
CSV Files ............................................................................................................................................. 289
Understanding CSV Files .................................................................................................................... 292
Text Files............................................................................................................................................. 292
XML Files ............................................................................................................................................ 293
Excel ................................................................................................................................................... 295
Adding Data from Excel Tables inside the Current Workbook ............................................................. 296
Microsoft Access Databases............................................................................................................... 297

Relational Databases: SQL Server ................................................................................ 298
Automatically Loading Related Tables ................................................................................................ 301
Database Options ............................................................................................................................... 301

Editing Existing Queries ............................................................................................... 308
Microsoft SQL Server Analysis Services Data Sources ................................................ 308
Add Items ........................................................................................................................................... 311
Collapse Columns ............................................................................................................................... 313

Microsoft SQL Server Analysis Services Tabular Data Sources .................................... 313
Other Data Sources ...................................................................................................... 313
Reusing Recent Data Sources ...................................................................................... 313
Reusing a Data Source ....................................................................................................................... 314
Pinning a Data Source ........................................................................................................................ 315
Old Data .............................................................................................................................................. 315

Connection Security ..................................................................................................... 315
Modifying Data Sources ............................................................................................... 318
Conclusion .................................................................................................................... 319
■Chapter 11: Transforming Data Sets Using Get & Transform ............................. 321
Get & Transform Queries .............................................................................................. 322

Editing Data After a Data Load............................................................................................................ 322
Transforming Data Before Loading ..................................................................................................... 324

xvii


■ CONTENTS

Query or Load? ............................................................................................................. 324
The Get & Transform Query Editor ............................................................................... 325
The Applied Steps List ........................................................................................................................ 326
The Get & Transform Query Editor Ribbons ........................................................................................ 327

Data Set Shaping.......................................................................................................... 332
Renaming Columns............................................................................................................................. 332
Reordering Columns ........................................................................................................................... 333
Removing Columns ............................................................................................................................. 334
Merging Columns ............................................................................................................................... 334
Removing Records.............................................................................................................................. 336
Removing Duplicate Records.............................................................................................................. 339
Sorting Data ........................................................................................................................................ 340
Reversing the Row Order .................................................................................................................... 341

Filtering Data ................................................................................................................ 342
Selecting Specific Values.................................................................................................................... 342
Finding Elements in the Filter List ...................................................................................................... 343
Filtering Text Ranges .......................................................................................................................... 344
Filtering Numeric Ranges ................................................................................................................... 344
Filtering Date and Time Ranges.......................................................................................................... 344
Filtering Data ...................................................................................................................................... 345


Counting the Rows in a Data Set .................................................................................. 346
Conclusion .................................................................................................................... 347
■Chapter 12: Data Cleansing with Get & Transform ............................................ 349
Viewing a Full Record................................................................................................... 349
Get & Transform Query Editor Context Menus .............................................................. 350
Changing Data Type ...................................................................................................... 351
Detecting Data Types .................................................................................................... 353
Replacing Values .......................................................................................................... 353

xviii


■ CONTENTS

Transforming Column Contents .................................................................................... 355
Text Transformation ............................................................................................................................ 355
Removing Leading and Trailing Spaces .............................................................................................. 357
Number Transformations .................................................................................................................... 357
Calculating Numbers .......................................................................................................................... 358
Date Transformations ......................................................................................................................... 360
Time Transformations ......................................................................................................................... 362
Duration .............................................................................................................................................. 362

Filling Down.................................................................................................................. 363
Using the First Row As Headers ................................................................................... 366
Grouping Records ......................................................................................................... 366
Conclusion .................................................................................................................... 369
■Chapter 13: Data Mashup with Get & Transform ............................................... 371
The Get & Transform View Ribbon ................................................................................ 371

Extending Data ............................................................................................................. 372
Duplicating Columns .................................................................................................... 373
Splitting Columns ......................................................................................................... 373
Splitting Column by a Delimiter .......................................................................................................... 374
Splitting Columns by Number of Characters....................................................................................... 376

Merging Columns ......................................................................................................... 376
Custom Columns .......................................................................................................... 377
Index Columns .............................................................................................................. 379
Merging Data ................................................................................................................ 381
Adding Data ........................................................................................................................................ 381
Aggregating Data During a Merge Operation...................................................................................... 384
Types of Join....................................................................................................................................... 388
Joining on Multiple Columns .............................................................................................................. 389
Preparing Data Sets for Joins ............................................................................................................. 390
Correct and Incorrect Joins ................................................................................................................ 391

xix


■ CONTENTS

Examining Joined Data ....................................................................................................................... 391
The Expand and Aggregate Buttons ................................................................................................... 393

Appending Data ............................................................................................................ 394
Adding the Contents of One Query to Another .................................................................................... 394
Adding Multiple Files from a Source Folder ....................................................................................... 395

Changing the Data Structure ........................................................................................ 397

Unpivoting Tables................................................................................................................................ 398
Pivoting Tables .................................................................................................................................... 399
Transposing Rows and Columns ......................................................................................................... 401

Managing the Transformation Process ......................................................................... 401
Modifying a Step................................................................................................................................. 402
Renaming a Step ................................................................................................................................ 402
Deleting a Step or a Series of Steps ................................................................................................... 402
Adding a Step ..................................................................................................................................... 403
Altering Process Step Sequencing ..................................................................................................... 403
An Approach to Sequencing ............................................................................................................... 404
Error Records...................................................................................................................................... 404
Removing Errors ................................................................................................................................. 404
Duplicating Part of a Query................................................................................................................. 405

Managing Queries ........................................................................................................ 405
Organizing Queries ............................................................................................................................. 406
Grouping Queries ................................................................................................................................ 406
Duplicating Queries ............................................................................................................................ 408
Referencing Queries ........................................................................................................................... 408
Add a Column As a New Query ........................................................................................................... 408

Pending Changes ......................................................................................................... 409
Copying Data from Get & Transform ............................................................................. 409
Conclusion .................................................................................................................... 410

xx


■ CONTENTS


■Chapter 14: Extending the Excel Data Model Using Power Pivot....................... 411
Power Pivot .................................................................................................................. 412
Launching Power Pivot ....................................................................................................................... 412
The Power Pivot Window .................................................................................................................... 413

Data Model or Query?................................................................................................... 414
The Power Pivot Ribbons.............................................................................................. 414
The Home Ribbon ............................................................................................................................... 414
The Design Ribbon.............................................................................................................................. 416
The Advanced Ribbon ......................................................................................................................... 417

Managing Power Pivot Data ......................................................................................... 418
Manipulating Tables ............................................................................................................................ 419
Manipulating Columns ........................................................................................................................ 419

Power Pivot Data Types ................................................................................................ 422
Formatting Power Pivot Data .............................................................................................................. 422
Currency Formats ............................................................................................................................... 423

Preparing Data for Analysis .......................................................................................... 424
Categorize Data .................................................................................................................................. 425
Apply a Default Summarization .......................................................................................................... 426
Define Sort by Columns ...................................................................................................................... 427

Sorting Data in Power Pivot Tables .............................................................................. 428
Designing a Data Model ............................................................................................... 429
Data View and Diagram View.............................................................................................................. 430
Creating Relationships........................................................................................................................ 433
Creating Relationships Manually ........................................................................................................ 434

Creating Relationships Automatically ................................................................................................. 435
Deleting Relationships ........................................................................................................................ 436
Managing Relationships ..................................................................................................................... 436

Preparing the Data Model............................................................................................. 439
Default Field Set ........................................................................................................... 440

xxi


■ CONTENTS

Defining Table Behavior ................................................................................................ 442
Row Identifier ..................................................................................................................................... 442
Keep Unique Rows.............................................................................................................................. 444
Default Label ...................................................................................................................................... 444
Set a Default Aggregation (Summarize By) ........................................................................................ 445

Preparing Images for Power View ................................................................................ 447
Image URLs .................................................................................................................. 447
Default Image ............................................................................................................... 448
Preparing Hyperlinks for Power View ........................................................................... 448
Creating Hierarchies ..................................................................................................... 448
Modifying Hierarchies .................................................................................................. 450
Adding a Level to a Hierarchy ............................................................................................................. 450
Removing a Level from a Hierarchy .................................................................................................... 450
Altering the Levels in a Hierarchy ....................................................................................................... 451
Deleting a Hierarchy ........................................................................................................................... 451
Hiding the Original Field ..................................................................................................................... 451


Key Performance Indicators ........................................................................................ 451
Creating a KPI ..................................................................................................................................... 452
KPI Options ......................................................................................................................................... 453
KPI Descriptions ................................................................................................................................. 454
Calculated KPI Targets ........................................................................................................................ 456
Modifying a KPI ................................................................................................................................... 456
Deleting a KPI ..................................................................................................................................... 456

Perspectives ................................................................................................................. 457
Creating a Perspective........................................................................................................................ 457
Applying a Perspective ....................................................................................................................... 458

Optimizing File Size ...................................................................................................... 459
Copying Data from Power Pivot ................................................................................... 460
Conclusion .................................................................................................................... 461

xxii


■ CONTENTS

■Chapter 15: Extending the Data Model with Calculated Columns ..................... 463
Types of Calculations.................................................................................................... 464
New Columns ............................................................................................................... 464
Naming Columns .......................................................................................................... 465
Concatenating Column Contents .................................................................................. 466
Tweaking Text ............................................................................................................... 468
Simple Calculations ..................................................................................................... 470
Math Operators ................................................................................................................................... 471
Rounding Values ................................................................................................................................. 472


Calculating Across Tables ............................................................................................. 473
Choosing the Correct Table for Linked Calculations ..................................................... 474
Cascading Column Calculations ................................................................................... 475
Refreshing Data............................................................................................................ 475
Using Functions in New Columns ................................................................................. 476
Safe Division ....................................................................................................................................... 476
Counting Reference Elements ............................................................................................................ 478
Statistical Functions ........................................................................................................................... 479
Applying a Specific Format to a Calculation ....................................................................................... 480

Correcting and Removing Errors .................................................................................. 483
Simple Logic: The IF() Function .................................................................................... 483
Exception Indicators ........................................................................................................................... 483
Creating Alerts .................................................................................................................................... 484
Comparison Operators ........................................................................................................................ 485
Flagging Data ..................................................................................................................................... 485
Nested IF() Functions .......................................................................................................................... 486
Creating Custom Groups Using Multiple Nested IF() Statements ....................................................... 488
Multiline Formulas .............................................................................................................................. 489

xxiii


■ CONTENTS

Complex Logic .................................................................................................................................... 489
Formatting Logical Results ................................................................................................................. 493

Making Good Use of the Formula Bar........................................................................... 494

Conclusion .................................................................................................................... 494
■Chapter 16: Adding Measures to the Data Model .............................................. 495
Introducing Measures .................................................................................................. 495
A First Measure: Number of Cars Sold................................................................................................ 495
Basic Aggregations in Measures ........................................................................................................ 498
Using Multiple Measures .................................................................................................................... 500
Cross-Table Measures ........................................................................................................................ 503
More Advanced Aggregations ............................................................................................................. 505

Filter Context ................................................................................................................ 508
Row Context ....................................................................................................................................... 508
Query Context ..................................................................................................................................... 508
Filter Context ...................................................................................................................................... 509

Filtering Data in Measures ........................................................................................... 509
Simple Filters ............................................................................................................... 509
Text Filters .......................................................................................................................................... 509
Numeric Filters ................................................................................................................................... 511

More Complex Filters ................................................................................................... 512
Multiple Criteria in Filters ................................................................................................................... 513
Using Multiple Filters .......................................................................................................................... 514

Calculating Percentages of Totals ................................................................................ 515
A Simple Percentage .......................................................................................................................... 515
Removing Multiple Filter Elements ..................................................................................................... 517
Visual Totals ........................................................................................................................................ 518
The ALLEXCEPT() Function .................................................................................................................. 519

Filtering on Measures................................................................................................... 521

Displaying Rank............................................................................................................ 522
A Few Comments and Notes on Using Measures......................................................... 524
xxiv


■ CONTENTS

Managing Measures ..................................................................................................... 524
Formatting Measures ................................................................................................... 525
Formatting Measures ......................................................................................................................... 525
Hiding Measures ................................................................................................................................. 526

Calculation Options ...................................................................................................... 527
Conclusion .................................................................................................................... 527
■Chapter 17: Analyzing Data over Time with DAX ............................................... 529
Simple Date Calculations ............................................................................................. 529
Date and Time Formatting .................................................................................................................. 532
Calculating the Age of Cars Sold ........................................................................................................ 535
Calculating the Difference Between Two Dates .................................................................................. 535

Adding Time Intelligence to a Data Model .................................................................... 538
Creating and Applying a Date Table .............................................................................. 538
Creating a Date Table in Excel ...................................................................................... 539
Marking a Table as a Date Table ......................................................................................................... 541

Creating the Date Table in Power Pivot ........................................................................ 542
Adding Sort By Columns to the Date Table ......................................................................................... 546
Date Table Techniques ........................................................................................................................ 546
Adding the Date Table to the Data Model ........................................................................................... 547


Applying Time Intelligence ........................................................................................... 548
YearToDate, QuarterToDate, and MonthToDate Calculations ............................................................... 549
Analyze Data As a Ratio over Time ..................................................................................................... 551
Comparing a Metric with the Result from a Range of Dates .............................................................. 553

Comparisons with Previous Time Periods ................................................................... 556
Comparison with a Parallel Period in Time................................................................... 558
Comparing Data from Previous Years ................................................................................................. 558
Comparing with the Same Date Period from a Different Quarter, Month, or Year ............................... 560

Rolling Aggregations over a Period of Time.................................................................. 562
Conclusion .................................................................................................................... 564

xxv


×