Artificial Intelligence with Microsoft Power BI (Jen Stirrup Thomas J. Weinandy) (Z-Library)
Author: Jen Stirrup, Thomas J. Weinandy
教育
No Description
📄 File Format:
PDF
💾 File Size:
42.6 MB
44
Views
0
Downloads
0.00
Total Donations
📄 Text Preview (First 20 pages)
ℹ️
Registered users can read the full content for free
Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.
📄 Page
1
Jennifer Stirrup & Thomas J. Weinandy Artificial Intelligence with Microsoft Power BI Simpler AI for the Enterprise
📄 Page
2
DATA SCIENCE “An excellent resource for those looking to dive into the world of data science and statistics, especially when it comes to applying AI within Power BI. This book provides a comprehensive introduction to these complex subjects and includes practical examples that make it accessible for all levels of readers.” —Richa Sagar Data Scientist, Intel Corporation Artificial Intelligence with Microsoft Power BI linkedin.com/company/oreilly-media youtube.com/oreillymedia Advance your Power BI skills by adding AI to your repertoire at a practice level. With this practical book, business-oriented data analysts and developers will learn the terminologies, practices, and strategy necessary to successfully incorporate AI into your business intelligence estate. Jennifer Stirrup, CEO of AI and BI leadership consultancy Data Relish, and Thomas Weinandy, research economist at Upside, show you how to use data already available to your organization. Springboarding from the skills you already possess, this book adds AI to your organization’s technical capability and expertise with Microsoft Power BI. By using your conceptual knowledge of BI, you’ll learn how to choose the right visual or tool for your AI work and identify its value and validity. • Use Power BI to build a good data model for AI • Demystify the AI terminology that you need to know • Identify AI project roles, responsibilities, and teams for AI • Apply Power BI’s free and premium pretrained machine learning models • Train models with AutoML, Azure ML, Python, or R and deploy them in Power BI • Improve your business AI maturity level with Power BI • Use the AI feedback loop to help you get started with the next project Jennifer Stirrup is an internationally recognized thought leader, influencer, keynote speaker, and AI expert. Dr. Thomas J. Weinandy is a former data scientist and current research economist at Upside, the two-sided promotions marketplace for brick-and-mortar retail. US $69.99 CAN $87.99 ISBN: 978-1-098-11275-2
📄 Page
3
978-1-098-11275-2 [LSI] Artificial Intelligence with Microsoft Power BI by Jennifer Stirrup and Thomas J. Weinandy Copyright © 2024 Data Relish Ltd and Thomas J. Weinandy. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (https://oreilly.com). For more information, contact our corporate/institu‐ tional sales department: 800-998-9938 or corporate@oreilly.com. Acquisitions Editor: Michelle Smith Development Editor: Angela Rufino Production Editor: Kristen Brown Copyeditor: Paula L. Fleming Proofreader: J.M. Olejarz Indexer: Sue Klefstad Interior Designer: David Futato Cover Designer: Karen Montgomery Illustrator: Kate Dullea April 2024: First Edition Revision History for the First Edition 2024-03-28: First Release See https://oreilly.com/catalog/errata.csp?isbn=9781098112752 for release details. The O’Reilly logo is a registered trademark of O’Reilly Media, Inc. Artificial Intelligence with Microsoft Power BI, the cover image, and related trade dress are trademarks of O’Reilly Media, Inc. The views expressed in this work are those of the authors and do not represent the publisher’s views. While the publisher and the authors have used good faith efforts to ensure that the information and instructions contained in this work are accurate, the publisher and the authors disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and/or rights.
📄 Page
4
Table of Contents Preface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix 1. Getting Started with AI in the Enterprise: Your Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Overview of Power BI Data Ingestion Methods 2 Workflows in Power BI That Use AI 3 How Are Dataflows Created? 3 Things to Note Before Creating Workflows 16 Streaming Dataflows and Automatic Aggregations 16 Getting Your Data Ready First 16 Getting Data Ready for Dataflows 16 Where Should the Data Be Cleaned and Prepared? 17 Real-Time Data Ingestion Versus Batch Processing 19 Real-Time Datasets in Power BI 19 Batch Processing Data Using Power BI 22 Importing Batch Data with Power Query in Dataflows 23 The Dataflow Calculation Engine 24 Dataflow Options 24 DirectQuery in Power BI 25 Import Versus Direct Query: Practical Recommendations 25 Premium, Pro, and Free Power BI 26 Summary 27 2. A Great Foundation: AI and Data Modeling. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 What Is a Data Model? 30 What Is a Fact Table? 30 Why Is Data Modeling Important? 31 Why Are Data Models Important in Power BI? 33 Why Do We Need a Data Model for AI? 34 iii
📄 Page
5
Advice for Setting Up a Data Model for AI 35 Analytics Center of Excellence 35 Earning Trust Through Data Transactions 36 Agile Data Warehousing: The BEAM Framework 36 Data Modeling Disciplines to Support AI 38 Data Modeling Versus AI Models 41 Data Modeling in Power BI 41 What Do Relationships Mean for AI? 45 Flat File Structure Versus Dimensional Model Structure in Power BI 50 Summary 73 3. Blueprint for AI in the Enterprise. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 What Is a Data Strategy? 76 Artificial Intelligence in Power BI Data Visualization 78 Insights Using AI 85 Automated Machine Learning (AutoML) in Power BI 87 Cognitive Services 88 Data Modeling 88 Real-World Problem Solving with Data 89 Binary Prediction 90 Classification 93 Regression 95 Practical Demonstration of Binary Prediction to Predict Income Levels 99 Gather the Data 100 Create a Workspace 100 Create a Dataflow 100 Model Evaluation Reports in Power BI 111 Summary 115 4. Automating Data Exploration and Editing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 The Transformational Power of Automation 117 Surviving (and Thriving with) Automation 119 AI Automation in Power BI 120 AI in Power Query 122 Get Data from Web by Example 122 Demo 4-1: Get Data from Web by Example 123 Add Column from Examples 131 Demo 4-2: Add Column from Examples 132 Data Profiling 134 Demo 4-3: Data Profiling 135 Table Generation 137 Demo 4-4: Table Generation 138 iv | Table of Contents
📄 Page
6
Fuzzy Matching 142 Demo 4-5: Fuzzy Matching 143 Intelligent Data Exploration 149 Quick Insights 150 Demo 4-6: Quick Insights 151 Report Creation 156 Demo 4-7: Report Creation 156 Smart Narrative 160 Summary 164 5. Working with Time Series Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 More Than Just Timestamps 165 The Components of a Time Series 168 Changes to a Time Series 169 How Trend Lines Work in Power BI 171 Limitations of Trend Lines 172 Demo 5-1: Exploring Taxi Trip Data 172 Forecasting 182 Forecasting for Business 183 How Forecasting Works 183 Limitations of Forecasting 184 Demo 5-2: Forecasting Taxi Trip Data 184 Anomaly Detection 187 Anomaly Detection for Business 188 How Anomaly Detection Works 188 Limitations of Anomaly Detection 189 Demo 5-3: Anomaly Detection with Taxi Trip Data 190 Summary 193 6. Cluster Analysis and Segmentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195 Cluster Analysis for Business 195 Segmentation Meets Data Science 196 Preprocessing Data for Cluster Analysis 198 How Cluster Analysis Works in Power BI 200 Limitations of Cluster Analysis 201 Demo 6-1: Cluster Analysis with AirBnB Data 201 Summary 211 7. Diving Deeper: Using Azure AI Services. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 Supporting Data-Driven Decisions with a Data Dictionary 214 What Is Azure AI Services? 215 Accessing Azure AI Services in Power BI 216 Table of Contents | v
📄 Page
7
Creating an Azure AI Services Resource 216 Creating a Power BI Report 220 OpenAI ChatGPT and Power BI 220 What Is the Purpose of the Exercise? 220 Exercise Prerequisites 221 Azure OpenAI and Power BI Example 221 Generating a Secret Key and Code from the OpenAI Website 224 Creating a Streaming Power BI Dataset 229 Dashboard Didn’t Work? 258 Summary 259 8. Text Analytics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261 Custom Models Versus Pretrained Models 262 Text as Data 263 Limitations of Text Analytics 264 Demo 8-1: Ingest AirBnB Data 265 Language Detection 270 How It Works 270 Performance and Limitations 270 Demo 8-2: Language Detection 271 Key Phrase Extraction 276 How It Works 277 Performance and Limitations 278 Demo 8-3: Key Phrase Extraction 278 Sentiment Analysis 282 How It Works 283 Recommendations and Limitations 283 Demo 8-4: Sentiment Analysis 284 Demo 8-5: Exploring a Report with Text Analytics 290 Summary 292 9. Image Tagging. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 Images as Data 293 Deep Learning 295 A Simple Neural Network 296 Image Tagging for Business 299 How It Works 300 Limitations of Vision 302 Demo 9-1: Ingest AirBnB Data 303 Demo 9-2: Image Tagging 308 Demo 9-3: Exploring a Report with Vision 314 Summary 319 vi | Table of Contents
📄 Page
8
10. Custom Machine Learning Models. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321 AI Business Strategy 321 Organizational Learning with AI 322 Successful Organizational Behaviors 324 Custom Machine Learning 324 Machine Learning Versus Typical Programming 325 Narrow AI Versus General AI 326 Azure Machine Learning 328 Azure Subscription and Free Trial 330 Azure Machine Learning Studio 330 Demo 10-1: Forecasting Vending Machine Sales 337 Summary 359 11. Data Science Languages: Python and R in Power BI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361 Python Versus R 363 Limitations 365 Setup 365 Setting Up Python 366 Setting Up R 372 Ingestion 374 Ingesting Data with Python 375 Ingesting Data with R 378 Transformation 380 Transforming Data with Python 381 Transforming Data with R 384 Visualization 386 Visualizing Data with Python 386 Visualizing Data with R 390 Machine Learning 393 Using a Pretrained Model with Python on Transform 394 Training a Model with R on Ingest 398 Summary 401 12. Making Your AI Production-Ready with Power BI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403 Strategies to Help Evaluate Models 404 Scenario Without Heteroscedasticity 404 Scenario with Heteroscedasticity 404 How Does Heteroscedasticity Affect AI Models? 405 What Can Be Done If Heteroscedasticity Is Suspected? 405 Making Your AI Model Ready for the Real World 406 Assessing the Costs and Benefits to the Business 407 Example ROI Calculation 409 Table of Contents | vii
📄 Page
9
Can the Business Teams Have Confidence in the AI Model? 411 Is the Model Result Just a Fluke? 411 Assuring Ongoing Model Performance 412 Making Your AI Production-Ready in Power BI 413 Data Lineage for the AI Model 420 Using the Scored Output from the Model in a Power BI Report 420 Summary 420 13. The AI Feedback Loop. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423 How Do You Start the Next Project? 423 How Does Feedback Affect the Training and Development of AI Models? 424 AI and Edge Cases in Feedback 424 How Can Feedback Help Fix Errors in an AI Model? 426 AI, Bias, and Fairness 426 Explainable AI and Feedback 428 How Can Members of Organizations Address Ethics and AI? 428 Transfer Learning in Model Training 431 How Are Other Organizations Using the AI Feedback Loop? 432 How Can the AI Feedback Loop Help You? 433 AI and Power BI—Over to You! 434 Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437 viii | Table of Contents
📄 Page
10
1 Grand View Research, Artificial Intelligence Market Size, Share & Trends Analysis Report by Solution (Hard‐ ware, Software, Services), by Technology (Deep Learning, Machine Learning, NLP), by End-use, by Region, and Segment Forecasts, 2023–2030, https://oreil.ly/DYpAn. Preface The adoption of artificial intelligence (AI) in businesses has seen significant growth and is impacting various industries in diverse ways. As of 2023, the global AI market was valued at $136.6 billion, and it is anticipated to reach $1.8 trillion by 2030.1 Fur‐ ther, the global acquisition rate of AI has increased in recent years, with a significant uptick in AI utilization across different business sectors. Regarding specific industry impacts, AI is expected to drive a substantial boost to gross domestic product (GDP) in various sectors. This widespread adoption emphasizes AI’s versatility and potential with respect to data transformation, which is foundational to the success of all businesses. Due to the promise of AI, companies are keen to leverage AI as a Service (AIaaS) platforms to use sophisticated AI tools without needing vast in-house exper‐ tise. For example, AI will revolutionize customer interactions in the retail industry. Experts predict that 19 in every 20 customer interactions will be AI assisted by 2025, necessitating dependence on AI for enriching customer service and engagement. What Is the Current State of AI Technology in Businesses? At the time of this writing, businesses are increasingly using AI to streamline pro‐ cesses and increase productivity through automation. More and more, organizations use AI to automate tasks such as data entry, customer services like chatbots, and inventory management. This automation increases efficiency and allows employees to focus on the creative and innovative tasks that make us human. Humans cannot hold billions of data points simultaneously in our heads, so we develop tools such as AI and Power BI! Businesses are increasingly using AI to analyze large datasets and extract insights, as well as to support data analytics via data exploration and data engineering. As of ix
📄 Page
11
2 Josh Howarth, “57 NEW AI Statistics,” Exploding Topics, February 2, 2024, https://explodingtopics.com/blog/ ai-statistics. 2023, research shows that 48% of businesses use machine learning, data analysis, and AI tools to maintain the accuracy of their big data stores.2 AI can be another friend at the analytics table, helping to forecast future trends and make data-driven decisions. It applies to many spheres of business as well, such as customer behavior analysis, social media analytics, and operational inefficiencies. AI can support personalization by analyzing customer data, bringing insights to everything from how to engage new customers to how to retain customers and reduce churn. Businesses can use AI to craft recommendations, relevant content, and marketing messages for each customer lifecycle stage. AI systems also assist leaders in strategic planning and risk assessment. However, for this to be effective, the data has to be appropriately presented so that its meaning is clear. Using AI and data visualization together gives decision makers the best tools to make optimal decisions. You can support this journey by providing business leaders with comprehensive analyses in Power BI powered by AI. The Structure of This Book We see the use of AI in Power BI as a journey that brings together many parts of a business, such as data, business goals, and cloud-computing infrastructure. The book’s structure is designed to help you navigate this journey in a logical manner. Every journey needs a map, so we start our journey by providing a roadmap in Chapter 1, “Getting Started with AI in the Enterprise: Your Data”. Data modeling is a timeless skill that transcends technology—but is sometimes forgotten! In Chapter 2, “A Great Foundation: AI and Data Modeling”, we cover what you need to know so that your data is in great shape for your journey in AI and Power BI. Businesses usually want everything done in a manner that is good, fast, and cheap! We show you how to get started with OpenAI and ChatGPT with Power BI in Chapter 3, “Blueprint for AI in the Enterprise”. One blocker to getting started quickly is the data. If businesses think that their data is perfect, most likely they have not looked properly! In Chapter 4, “Automating Data Exploration and Editing”, we help you to identify data quality issues before you start to go down the wrong path. From Chapters 5 to 11, we take you through practical examples where you will use AI and Power BI to tackle real-world problems, learning how to help yourself and your business. In Chapter 5, “Working with Time Series Data”, we will put our best foot forward with time series analysis, a tool that is important for analyzing business trends. Chapter 6, “Cluster Analysis and Segmentation”, shows how to use cluster x | Preface
📄 Page
12
analysis and segmentation to support your business needs when grouping together similar entities. In Chapter 7, “Diving Deeper: Using Azure AI Services”, you’ll see how to use Azure AI Services, Microsoft’s latest AI offering, to help you quickly get on board with AI. AI and Power BI are not only for traditional data with a rectangular shape, such as spreadsheets or CSV files. Technologies like text processing are used in customer service to understand customer feedback, enhancing interaction and service quality. In Chapter 8, “Text Analytics”, we will cover this topic in detail. Image data can be challenging in AI, and we will explore this type of data in Chapter 9, “Image Tagging”. What happens when you need to customize your AI? We cover this topic in Chap‐ ter 10, “Custom Machine Learning Models”, so you can move further in your AI journey. In Chapter 11, “Data Science Languages: Python and R in Power BI”, we dive into Python and R to support you as you develop your AI capabilities. In Chapter 12, “Making Your AI Production-Ready with Power BI”, we take the AI from your laptop and put it into production! We look at how you can iterate effectively in your AI development process. We finish by looking at AI and beyond by discussing ethics in Chapter 13, “The AI Feedback Loop”. There is a growing emphasis on ethical AI practices, mainly where AI interacts with customers. Businesses are becoming increasingly sensitive to the need to design and use AI in a way that is ethical, transparent, and compliant with privacy and data security guidelines. Overall, the application of AI in business is diverse and rapidly evolving, with new use cases emerging as the technology advances. Businesses increasingly recognize AI’s value in gaining a competitive advantage, improving customer experience, and streamlining operations. Why Did We Write This Book? AI is a significant and timely topic for businesses, and there is much interest in adopting it. Overall, the adoption of AI in businesses is on a robust upward trajec‐ tory, with its impact felt across every industry. AI technology enhances efficiency and productivity, drives innovation, and changes industry landscapes. Who Is This Book For? Understandably, people want to develop their careers to match the skill gap in AI. This book is aimed at reasonably data-savvy analysts and business intelligence users who are interested in rounding off their tool set by understanding how AI is used in Preface | xi
📄 Page
13
Power BI. Throughout the book, we provide practical examples so you can get started immediately in an actionable manner that is relevant to your business. Despite its business benefits, AI faces challenges, including data quality issues, a lack of skilled personnel, and a technology mix that can be confusing. There is also a general need to learn more about AI ethics. We are thrilled to take you on this journey of AI exploration, and we wrote this book to help you meet these challenges. We look forward to seeing how you can apply the knowledge in your business context. Conventions Used in This Book The following typographical conventions are used in this book: Italic Indicates new terms, URLs, email addresses, filenames, and file extensions. Constant width Used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, databases, data types, environment variables, statements, and keywords. Constant width bold Shows commands or other text that should be typed literally by the user. Constant width italic Shows text that should be replaced with user-supplied values or by values deter‐ mined by context. This element signifies a general note. This element indicates a warning or caution. xii | Preface
📄 Page
14
Using Code Examples Supplemental material (code examples, exercises, etc.) is available for download at https://github.com/tomweinandy/ai-with-power-bi. If you have a technical question or a problem using the code examples, please email support@oreilly.com. This book is here to help you get your job done. In general, if example code is offered with this book, you may use it in your programs and documentation. You do not need to contact us for permission unless you’re reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing examples from O’Reilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your product’s documentation does require permission. We appreciate, but generally do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: “Artificial Intelligence with Microsoft Power BI by Jennifer Stirrup and Thomas J. Weinandy (O’Reilly). Copyright 2024 Data Relish Ltd and Thomas J. Weinandy, 978-1-098-11275-2.” If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at permissions@oreilly.com. O’Reilly Online Learning For more than 40 years, O’Reilly Media has provided technol‐ ogy and business training, knowledge, and insight to help companies succeed. Our unique network of experts and innovators share their knowledge and expertise through books, articles, and our online learning platform. O’Reilly’s online learning platform gives you on-demand access to live training courses, in-depth learning paths, interactive coding environments, and a vast collection of text and video from O’Reilly and 200+ other publishers. For more information, visit https://oreilly.com. Preface | xiii
📄 Page
15
How to Contact Us Please address comments and questions concerning this book to the publisher: O’Reilly Media, Inc. 1005 Gravenstein Highway North Sebastopol, CA 95472 800-889-8969 (in the United States or Canada) 707-827-7019 (international or local) 707-829-0104 (fax) support@oreilly.com https://www.oreilly.com/about/contact.html We have a web page for this book, where we list errata, examples, and any additional information. You can access this page at https://oreil.ly/AI_microsoftPowerBI. For news and information about our books and courses, visit https://oreilly.com. Find us on LinkedIn: https://linkedin.com/company/oreilly-media. Watch us on YouTube: https://youtube.com/oreillymedia. Acknowledgments As I turn the final page of this remarkable journey, my heart brims with gratitude to and reverence for Lord Krishna, whose timeless wisdom and divine guidance have been the light in difficult times. Krishna’s teachings, encapsulated in the Bhagavad Gita, have been a constant source of inspiration, strength, and solace. It is with humble acknowledgment of His grace and blessings that I present this work. As I reflect upon the journey of writing this book, my heart is filled with profound grati‐ tude toward His Divine Grace A. C. Bhaktivedanta Swami Prabhupada. Through his example, I have learned the importance of living a life rooted in spiritual principles, and his teachings have guided me through both the challenges and joys encountered during the process of writing this book. Hare Krishna, —Jennifer Stirrup I wish to sincerely thank each of my former coworkers at BlueGranite. I learned so much from you about leveraging large datasets and solving real business problems for clients. Our time together affirmed my professional journey and enriched my personal life. This book would not have been possible without all of you, so it makes perfect sense that I dedicate this book to you as well. —Thomas Weinandy xiv | Preface
📄 Page
16
CHAPTER 1 Getting Started with AI in the Enterprise: Your Data Power BI is Microsoft’s flagship business analytics service that provides interactive visualizations and business intelligence capabilities. Power BI is a business-focused technology with an easy-to-use interface that makes it easy to underestimate its power. In this chapter, let’s explore the essential ingredient of getting the most out of Power BI: getting your data ready. What problems are specific to the self-service data preparation domain? As anyone who has tried to merge data in Excel knows, cleaning data is a frustrating and lengthy process. It can be exacerbated by mistakes in formulas and human error, as well as having access only to a sample dataset. Moreover, the business analysts may not have straightforward access to the data in the first place. Business teams may have to procure data from across business silos, adding delays to an already frustrating process. Sometimes, they may even bend existing business processes or push boundaries to get the data they need. The frustration they feel gets in the way of exercising creativity when it comes to analyzing the data. Many organizations have a hidden industry of Excel spreadsheets that comprise the “little data” that runs the business. Often, IT cannot get any visibility into these data “puddles,” so it cannot manage them or exercise its role as guardian of the data. According to David Allen’s Get Things Done methodology, there is clear strategic value in having bandwidth to be creative. To be creative, people need to be free of distractions and incomplete tasks. When people deal with data, they can gain insights by being playful, but to do so, they need to be free to focus their time and attention on the analysis. Having to spend a lot of time on cleaning up a data mess often interferes with the creative process. Instead of gaining insights from a lake of big data, they may have only a series of murky data puddles to work with. This situation leads 1
📄 Page
17
to disappointment for the business leaders who expect astute observations and deep understanding from the business’s data. Overview of Power BI Data Ingestion Methods Power BI provides several ways to bring data into your reports and dashboards. In this chapter, we will focus on dataflows and datasets. The method you choose depends largely on your use case’s specific requirements and constraints and, in particular, on the nature of the data and the business needs. Let’s begin by discussing one important differentiator: real-time data versus batch-processed data. Real-time data is ingested and displayed as soon as it is acquired. The timeliness of the data is critical. Latency between data generation and data availability is minimal, often milliseconds to a few seconds. Real-time data allows decision makers or systems to act immediately based on current information, so it is critical in scenarios where immediate decisions or responses are needed. Real-time data is found in many areas, such as the Internet of Things (IoT), gaming, healthcare, and finance. The capability to promptly process and act on real-time data offers many benefits. It can give the business a competitive advantage, improve safety, enhance user experience, and even save lives in emergencies. Batch processing involves collecting and processing large volumes of data in groups, or batches, rather than processing each piece of data as it arrives at the system. Batch processing is typically used when data doesn’t need to be available in real time. The data can be stored temporarily and processed later, often during a period of lower system demand. For example, batch processing is appropriate when the data source has only intermittent network access and the data can be accessed only when the data source is available. Also, it can be more expensive to process data in real time, so when immediate access to the data is unnecessary, a business often determines that batch processing is sufficient. Now that we’ve gotten an overview of the two basic data velocity options, let’s take a look at the different methods of data ingestion in Power BI. The import data method involves importing data from a source into Power BI. Once the data is imported, it is stored in a highly compressed, in-memory format within Power BI. With the import data method, report interaction is very fast and responsive to user clicks and ticks on the Power BI canvas. 2 | Chapter 1: Getting Started with AI in the Enterprise: Your Data
📄 Page
18
The direct query method sets up a direct connection to the data source. When a user interacts with a report, queries are sent to the source system to retrieve and display the data on the Power BI dashboard. No data is copied to or stored inside Power BI. The live connection method is similar to direct query, but it is explicitly intended for making connections to Analysis Services models. Power BI dataflows are a Power BI service feature based in the Microsoft Azure cloud. Dataflows allow you to connect to, transform, and load data into Power BI. The transformed data can be used in both Import and DirectQuery modes. The process runs in the cloud independently from any Power BI reports and can feed data into different reports. The composite model approach allows Power BI developers to create reports using either the direct query or import data methods. For example, real-time data could be set alongside reference data that does not need to be real-time, such as geographic data. Using the dataset method, you can create reports based on existing Power BI datasets. A dataset can be reused many times for consistency across multiple reports. This chapter will explore the potential of dataflows to resolve the previously men‐ tioned data preparation issues. Workflows in Power BI That Use AI A dataflow is a collection of tables created and managed in workspaces in the Power BI service. A table is a set of columns used to store data, much like a table within a database. It is possible to add and edit tables in the dataflow. The workflow also permits the management and scheduling of data refreshes, which are set up directly from the workspace. How Are Dataflows Created? To create a dataflow, first go to https://www.powerbi.com to launch the Power BI service in a browser. Next, create a workspace from the navigation pane on the left, as shown in Figure 1-1. Workflows in Power BI That Use AI | 3
📄 Page
19
Figure 1-1. Creating a workspace The workspace stores the dataflow. Creating a dataflow is straightforward, and here are a few ways to build one. 4 | Chapter 1: Getting Started with AI in the Enterprise: Your Data
📄 Page
20
Creating a dataflow by importing a dataset In the workspace, there is a drop-down list to create new resources, such as paginated reports or dashboards. Under New is an option to create a new dataflow, as shown in Figure 1-2. Figure 1-2. Creating a dataflow Then, you are presented with the four options shown in Figure 1-3. Figure 1-3. Options for creating a dataflow Workflows in Power BI That Use AI | 5
The above is a preview of the first 20 pages. Register to read the complete e-book.