Microsoft Power BI Cookbook Creating Business Intelligence Solutions of Analytical Data Models, Reports, and Dashboards Brett Powell BIRMINGHAM - MUMBAI Microsoft Power BI Cookbook Copyright © 2017 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 author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be 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 First published: September 2017 Production reference: 1220917 Published by Packt Publishing Ltd Livery Place 35 Livery Street Birmingham B3 2PB, UK ISBN 978-1-78829-014-2 www.packtpub.com Credits Author Copy Editor Brett Powell Vikrant Phadkay Reviewers Project Coordinator Gilbert Quevauvilliers Ruben Oliva Ramos Nidhi Joshi Juan Tomas Oliva Ramos Commissioning Editor Proofreader Amey Varangaonkar Safis Editing Acquisition Editor Indexer Varsha Shetty Tejal Daruwale Soni Content Development Editor Graphics Mayur Pawanikar Tania Dutta Technical Editor Production Coordinator Vivek Arora Arvindkumar Gupta Add a Connection to a SQL Server Database in MS Flow An existing database connection can be selected if there are multiple or a new connection can be configured Choose the SQL Server table, and then click on New Step and add an action Search for Power BI and select the Add rows to a dataset action Specify the Power BI App Workspace and Dataset; a RealTimeData table name will be applied automatically Associate the SQL Server table columns with the columns of the Power BI streaming dataset table Power BI add rows to a dataset action in MS Flow 10 Click on Save Flow and then update the flow with a descriptive name Configured and Active MS Flow The run history of the flow, including successful and unsuccessful executions, is available by clicking on the Flow name from My Flows Additionally, the My Flows page specific to the given flow allows for adding owners, viewing connections, opening the Flow in Edit mode, and turning the Flow off 11 Open a new Power BI Desktop file and click to Get Data from the Power BI service Navigate to the app workspace of the streaming dataset, select the dataset, and click on Load Streaming Dataset Accessed via Live Connection from Power BI Desktop 12 From the Modeling tab, click on New Measure to add report-level measures to support report visualizations Fields List in Power BI Desktop of the Streaming Dataset in the Power BI Service Distinct customers, total calls, and the calls in last minutes measure are added to the report: Calls in Last Minutes = VAR Prior5Mins = NOW() - 003472 Return CALCULATE(COUNTROWS('RealTimeData'),FILTER(ALL('RealTimeData'),RealTimeData[CallDate] >= Prior For a streaming dataset, it's likely necessary to configure data alerts and notifications in the Power BI Service Therefore, use card, gauge, or the standard KPI visual in building the report and pin these items to a dashboard to configure the alerts In this example, rows with date/time values greater than minutes prior to the current date/time are used for a gauge visual (1,440 minutes per day, /1440 = 003472) 13 Publish the report to the Power BI Service and optionally pin the visual(s) to a dashboard and configure alerts How it works Microsoft Flow MS Flows are conceptually similar to the control flow interface for SSIS packages MS Flow in Design Mode - Successful Execution MS Flow automatically added an apply to each container for the Power BI action and advises of success per step MS Flow in design mode—The more' context menu selected Complex logic can be added to MS flows via branching conditions, scopes, and looping constructs MS Flow is intended for self-service scenarios and business power users Logic apps is also a cloud-based integration service that can be supported by the on-premises data gateway, but it's more oriented toward developers and enterprise integration scenarios There's more Write capabilities and MS Flow premium Unlike Power BI, which only reads source data, PowerApps and MS Flow can both write or edit source data MS Flow actions for Oracle, including insert, delete, and update Certain connectors such as Oracle and IBM DB2 are only available in MS Flow premium pricing plans and are not included in MS Flow for Office 365 licenses Currently two premium flow plans are available at $5 and $15 per user per month See the linked plan feature table in See also for more details PowerApps Studio and mobile applications PowerApps Studio is a dedicated authoring application for Windows devices (version 8.1 or higher) PowerApps Studio in the Windows Store PowerApps can also be developed in the Office 365 web application like Microsoft Flow PowerApps Mobile and the MS Flow mobile app are both available for iOS and Android devices The MS Flow mobile app supports the same create and edit functionality and activity history details available in the Office 365 web application PowerApps can be designed for tablet and mobile form factors but will render on desktop as well The PowerApps mobile application can access and utilize PowerApps but does not create or edit PowerApps See also MS Flow plan feature matrix: http://bit.ly/2w5oeS7 ... content via the Power BI service and Power BI mobile applications Chapter 12, Integrating Power BI with Other Applications, highlights new and powerful integration points between Power BI and SSAS,... Using Power BI with Microsoft Flow and PowerApps Getting ready How to it Streaming Power BI dataset via MS Flow How it works Microsoft Flow There's more Write capabilities and MS Flow premium PowerApps... experience when consuming and interacting with Power BI reports in the Power BI service and on mobile devices Chapter 4, Creating Power BI Dashboards, covers Power BI dashboards constructed to provide