📄 Page
1
(This page has no text content)
📄 Page
2
Mastering Power BI Build Business Intelligence Applications Powered with DAX Calculations, Insightful Visualizations, Advanced BI Techniques, and Loads of Data Sources Chandraish Sinha www.bpbonline.com
📄 Page
3
FIRST EDITION 2022 Copyright © BPB Publications, India ISBN: 978-93-91030-728 All Rights Reserved. No part of this publication may be reproduced, distributed or transmitted in any form or by any means or stored in a database or retrieval system, without the prior written permission of the publisher with the exception to the program listings which may be entered, stored and executed in a computer system, but they can not be reproduced by the means of publication, photocopy, recording, or by any electronic and mechanical means. LIMITS OF LIABILITY AND DISCLAIMER OF WARRANTY The information contained in this book is true to correct and the best of author’s and publisher’s knowledge. The author has made every effort to ensure the accuracy of these publications, but publisher cannot be held responsible for any loss or damage arising from any information in this book. All trademarks referred to in the book are acknowledged as properties of their respective owners but BPB Publications cannot guarantee the accuracy of this information.
📄 Page
4
www.bpbonline.com
📄 Page
5
Dedicated to Ishie My daughter, who taught me that patience is a virtue.
📄 Page
6
About the Author Chandraish Sinha is the Founder/President of Ohio Computer Academy, a company dedicated to IT education. An IT trainer at heart, Chandraish resonates with his company’s slogan - Inspire, Educate and Evolve. He is a Business Intelligence learner and explorer. He has implemented multiple large and medium scale BI solutions. In his 22 years of career, Chandraish has worked with a variety of dashboarding applications such as Power BI, Tableau, Qlik View, Qlik Sense, IBM Cognos, Business Objects and Actuate. He is passionate about data and explores applications that provide better data insights. He has also authored multiple books on Tableau and Qlik View. His Amazon author profile can be viewed at the URL He blogs regularly on BI applications such as Power BI, Tableau and QlikView. These are the links to his blogs: https://ohiocomputeracademy.com/category/power-bi/ https://www.learntableaupublic.com/ https://www.learnallbi.com/
📄 Page
7
LinkedIn Profile: www.linkedin.com/in/chandraishsinha
📄 Page
8
About the Reviewer Saravanan Shanmugam (Sara) is a certified trainer for a plethora of Data Science and Data Visualization technologies viz., PowerBI, Snowflake, Tableau, Machine learning and Python. He has over 20 years experience in managing and delivering software projects. His data platform experience includes design and development of Business Intelligence Reporting solution with Power BI, Microsoft SQL Server, SharePoint, SSIS and SSAS. Sara has a Master’s degree in Business Administration with a specialization in Technology Management from Anna University and bachelor’s degree in Electronics and Communication. He has worked in various implementation projects and products across the globe on functionalities like ERP, EDI, Data Analytics using Microsoft Technologies.
📄 Page
9
Acknowledgement My sincere thanks to my readers who have supported my books so far and inspired me to go on. I personally read all their reviews and feedback. My gratitude to Saravanan Shanmugam, Technical Reviewer of this book for painstakingly going through the entire book and providing valuable suggestions. Finally, I would like to thank BPB Publications for giving me this opportunity. Book writing involves a lot of people and thanks to them for providing all the necessary assistance.
📄 Page
10
Preface Power BI visualization is gaining popularity in the business world due to its capability in modeling and effectively presenting the data. Through the years, Power BI has evolved into a powerful suite of products. In my career, I worked on different reporting and visualization applications such as Tableau, Qlik, IBM Cognos, Business Objects and Actuate. I feel Power BI is at par and sometimes more advantageous as compared to others. The functionalities included in Power BI are as vast as an ocean. Power BI desktop, Query editor, Visualizations, DAX formulas and Power BI Service make the application robust but at the same time can become a little difficult to understand. In this book, an attempt has been made to introduce the readers to the basics and then take them to more deeper concepts. This book covers all aspects of creating a project in Power BI from start to finish. As Power BI is getting adopted by more and more organizations, it is generating good career options. The purpose of writing this book is to equip readers with the essentials of Power BI in a nutshell. This book is useful for the novice IT aspirants ready to take a plunge and also for the seasoned IT professionals who want to switch their career to Power BI.
📄 Page
11
In writing this book, I have followed the same approach as observed in my other books. It is simple to follow and provides concepts followed by hands-on exercises. All the data and solution files are provided. The readers can follow the steps mentioned in the book and create their own application. The primary challenge I faced in writing this book are the changes introduced by Power BI. Few times, the look-and-feel of the application has changed. I have tried my best to keep up with the changes, but, in case some discrepancies are found remember, the changes are only in the interface and not in the concepts. A menu item may have shifted in the ribbon but it will be there. The way the functionality is implemented has not changed and remains the same. The primary goal of this book is to provide information and skills that are necessary to create a Power BI application. This book contains steps that will show readers how to install and create Power BI application. Over the 7 chapters in this book, you will learn the following: Chapter 1 covers the basics of Business Intelligence and explains all the important terms and definitions. It also explains different components of Power BI and what they do. It will assist in installing Power BI desktop and provides an overview of the data tables used in the book.
📄 Page
12
Chapter 2 explains how Power BI connects to data from disparate sources such as database tables, XLS files, relational database and many more. It also introduces Query editor and describes how to use it to shape the data. Chapter 3 deals with creating and optimizing a data model in Power BI. It covers relationships and how to create them in Power BI. It also explains how to create joins by using merge and append functionalities. Chapter 4 is a key chapter which explains Data Analysis Expression (DAX). DAX formulas are important for any Power BI implementation. This chapter covers all the main functions and shows how to implement them. Chapter 5 visualizations are important as they help in understanding the data. This chapter covers all the visualizations available in Power BI and explains when to use them. Chapter 6 describes components of Power BI Service. In this chapter, you will deploy the application created in the Power BI desktop to Power BI Service. This chapter also teaches how to connect to data and create visualizations in Power BI Service. Chapter 7 introduces to the concept of Row-level security (RLS). It is important to keep the application secured and users see only the data they are authorized to view.
📄 Page
13
Downloading the code bundle and coloured images: Please follow the link to download the Code Bundle and the Coloured Images of the book: https://rebrand.ly/5d8ca8 Errata We take immense pride in our work at BPB Publications and follow best practices to ensure the accuracy of our content to provide with an indulging reading experience to our subscribers. Our readers are our mirrors, and we use their inputs to reflect and improve upon human errors, if any, that may have occurred during the publishing processes involved. To let us maintain the quality and help us reach out to any readers who might be having difficulties due to any unforeseen errors, please write to us at : errata@bpbonline.com Your support, suggestions and feedbacks are highly appreciated by the BPB Publications’ Family.
📄 Page
14
Did you know that BPB offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.bpbonline.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at business@bpbonline.com for more details. At 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 BPB books and eBooks.
📄 Page
15
BPB is searching for authors like you If you're interested in becoming an author for BPB, please visit www.bpbonline.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea. The code bundle for the book is also hosted on GitHub at In case there's an update to the code, it will be updated on the existing GitHub repository. We also have other code bundles from our rich catalog of books and videos available at Check them out! PIRACY If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at business@bpbonline.com with a link to the material. If you are interested in becoming an author
📄 Page
16
If there is a topic that you have expertise in, and you are interested in either writing or contributing to a book, please visit REVIEWS Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at BPB can understand what you think about our products, and our authors can see your feedback on their book. Thank you! For more information about BPB, please visit
📄 Page
17
Table of Contents 1. Understanding the Basics Introduction Structure Objectives Understanding Business Intelligence Advantages of a Business Intelligence (BI) system Business Intelligence components Data sets Extract, Transform, and Load (ETL) Data warehouse Data mart Data model Star schema Snowflake schema Key Performance Indicator (KPI) Visualization Dashboard Power BI as a Business Intelligence application Functions of Power BI Power BI components Power BI Environment Different users of Power BI Power BI desktop developer Power BI Analyst Power User Executive User Power BI licensing Power BI desktop installation
📄 Page
18
Installation Overview of Power BI desktop Initiate a Power BI implementation as a developer Analyze dataset used in this book Power BI development setup Conclusion Questions Answers 2. Connect and Shape Introduction Structure Objectives Data connections in Power BI Connecting to data Connecting to database tables Loading the Orders table Understanding Power Query Editor Verifying the loaded query Loading Customers and Products tables Loading data from an Excel file Loading multiple CSV files from a folder Loading data from MS SQL server Import and DirectQuery Creating static table in Power BI Why do we need a static table in our model? Bonus section Connecting to web data source Connecting and loading the data from Microsoft SharePoint Connecting and loading the from Azure SQL
📄 Page
19
More on Query Editor Conclusion Questions Answers 3. Optimize Your Data Model Introduction Structure Objectives Introduction to data modeling Best practices of data modeling A word about relationships Review the loaded tables Creating a manual relationship between the Orders and Customers table Creating manual relationship between Products and Category tables Combining queries Using joins Joins Loading OrderDetails.xlsx Left outer join Right outer join Full outer join Left anti Right anti Combining queries using append Appending records from NewCustomers table to Customers table Conclusion Questions Answers
📄 Page
20
4. Data Analysis Expressions (DAX) Introduction Structure Objectives Introduction to DAX DAX functions Calculated Columns and Measures Calculated Columns Verify the UnitPrice calculation Calculated measure Quick measures Creating a Quick measure Mathematical functions Sum SumX SumX verses Sum Count functions Count CountA CountX CountAX CountBlank CountRows Information functions ISERROR USERNAME LOOKUPVALUE LOOKUPVALUE – SalesPerson_Location and Sales Person Table Logical functions If