Microsoft Power BI Quick Start Guide Second Edition Bring your data to life through data modeling, visualization, digital storytelling, and more Devin Knight Mitchell Pearson Bradley Schacht Erin Ostrowsky BIRMINGHAM - MUMBAI Microsoft Power BI Quick Start Guide Second Edition Copyright © 2020 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. Producers: Aarthi Kumaraswamy, Caitlin Meadows Acquisition Editor – Peer Reviews: Divya Mudaliar Content Development Editor: Alex Patterson Technical Editor: Karan Sonawane Project Editor: Mrunal Dave Copy Editor: Safis Editing Proofreader: Safis Editing Indexer: Priyanka Dhadke Presentation Designer: Pranit Padwal First published: July 2018 Second Edition: October 2020 Production reference: 1291020 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-80056-157-1 www.packt.com packt.com Subscribe to our online digital library for full access to over 7,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website. Why subscribe? • Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals • Learn better with Skill Plans built especially for you • Get a free eBook or video every month • Fully searchable for easy access to vital information • Copy and paste, print, and bookmark content Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.Packt.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details. At www.Packt.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks. Contributors About the authors Devin Knight is a Microsoft Data Platform MVP and the President at Pragmatic Works Training. At Pragmatic Works, Devin determines which courses are created, delivered, and updated for customers, including 15+ Power BI courses. This is the tenth SQL Server and Business Intelligence book that he has authored. Devin often speaks at conferences such as PASS Summit, PASS Business Analytics Conference, SQL Saturdays, and Code Camps. He is also a contributing member to several PASS Virtual Chapters. Making his home in Jacksonville, FL, Devin is a contributor at the local Power BI User Group. I must give thanks to God; without God in my life, I would not be as blessed as I am daily. Thanks for the amazing team of authors: Mitchell, Brad, and Erin have put in time after hours away from their families to bring this great book together. To my wife, Erin, and three children, Collin, Justin, and Lana, who were all patient during nights that daddy had to spend writing. Finally, I would like to thank Oliver Wood, the best Quidditch coach a rising star like myself could ask for. I know this will be the year we win the Quidditch cup and become champions. Mitchell Pearson has worked as a Data Platform Consultant and Trainer for the last 8 years. Mitchell has authored books on SQL Server, Power BI, and the Power Platform. His data platform experience includes designing and implementing enterprise-level Business Intelligence solutions with the Microsoft SQL Server stack (T-SQL, SSIS, SSAS, and SSRS), the Power Platform, and Microsoft Azure. Mitchell is very active in the community: • Running the local Power BI User Group • Presenting at user groups locally and virtually • Writing blogs at www.mitchellpearson.com and creating YouTube videos for MitchellSQL First of all, thank you to God for unending grace and mercy. Secondly, thank you to Brian Knight for giving me an incredible opportunity in the Business Intelligence field. Finally, thank you to my wife and kids for their unending encouragement and their sacrifice; without their support, I could not have contributed to this book. Bradley Schacht is a Senior Cloud Solution Architect (Data Platform) on the Microsoft State and Local Government team based in Jacksonville, FL. Bradley has authored three other SQL Server books. As a former consultant and trainer, he uses his experience on the Microsoft data platform to help customers architect quality end-to-end solutions for every business problem encountered. Bradley gives back to the community through speaking at events such as the PASS Summit, SQL Saturdays, Code Camps, and user groups across the USA, including locally at the Jacksonville SQL Server User Group (JSSUG). He is a contributor on www. SQLServerCentral.com and blogs on his personal site, www.BradleySchacht.com. I give thanks to God, who has blessed me with so many wonderful things in life and whom I would be lost without. Thanks to my amazing wife, Nichole, and our baby boy, Oliver. The support, encouragement, and family time you give me each and every day means more to me than you will ever know. Thanks to my co-authors, Devin, Mitchell, and Erin, who all worked hard and sacrificed to make this book possible. To everyone that has helped me throughout my career, thank you. Finally, I thank the Atlanta Braves for winning their first postseason series since 2001 and proving that dreams do come true. Please don't screw it up. I look forward to reflecting on this postseason with Oliver when he signs with the Braves in 2038. Erin Ostrowsky is a creative and passionate lifelong learner. She began her career as a business journalist and researcher and found herself drawn to the power of beautifully visualized data analysis. After living overseas, Erin returned to the USA looking to marry her communication background with a technical focus and found a life-changing opportunity to work as a trainer for Pragmatic Works, where she focused on creating new educational materials and delivering Power BI training around the USA. Erin focuses on the Power Platform tools and loves working on teams to build business intelligence solutions that businesses use and enjoy. Erin is thankful to Jesus Christ for showing her that love is the root of all beauty on Earth. She thanks her family, friends, and colleagues for teaching her about life and being part of the adventure. About the reviewer Gilbert Quevauvilliers has 10+ years of experience in delivering data solutions, and has a real passion for Power BI; he's been using Power BI since its inception at the end of 2014. Gilbert has also been using DAX from Excel 2010 when it was created, and has been named a Microsoft MVP from 2017 through to 2020. Gilbert has hands-on experience assisting organizations of all sizes in successfully implementing Power BI and the Microsoft Data Analytics Platform. Gilbert is fortunate enough to have spoken at various events (Microsoft Business Applications Summit, SQL Saturday's, Power BI user groups, and more), and is currently consulting through his own company, FourMoo (the name represents his four family members). With FourMoo, Gilbert provides Microsoft Power BI solutions for business challenges by using your data and working with your business users. Gilbert also has an active blog, which can be found at www.fourmoo.com/blog. I would like to say a big thanks to my family, for their endless support and for helping me find the time to review this book. Table of Contents Preface vii Chapter 1: Getting Started with Importing Data Options 1 Getting started 2 Importing data 4 Excel as a source 4 SQL Server as a source 6 Web as a source 8 DirectQuery 9 Limitations 11 Composite models 12 Live connection 14 Limitations 15 Which should I choose? 15 Summary 16 Chapter 2: Data Transformation Strategies 17 The Power Query Editor 18 Transform basics 19 Use First Row as Headers 20 Remove Columns 21 Change Type 22 Column From Examples 23 Advanced data transformation options 25 Conditional Columns 25 Fill Down 28 Unpivot 29 Merge Query 34 [ i ]