montreal powerbi user group - realtime power bi dashboards

46
Real Time Power BI Dashboards Guy Barrette MVP Azure, Freelance Dev/Architect http://guy.cloud

Upload: guy-barrette

Post on 11-Apr-2017

81 views

Category:

Technology


3 download

TRANSCRIPT

Page 1: Montreal PowerBI User Group - Realtime Power BI Dashboards

Real Time Power BI DashboardsGuy BarretteMVP Azure, Freelance Dev/Architecthttp://guy.cloud

Page 2: Montreal PowerBI User Group - Realtime Power BI Dashboards

Who are you?

Developer Analyst

Page 3: Montreal PowerBI User Group - Realtime Power BI Dashboards

The Goal

Build a Power BI dashboard that displays data in real

time

Page 4: Montreal PowerBI User Group - Realtime Power BI Dashboards

Data Refresh in Power BI

https://powerbi.microsoft.com/en-us/documentation/powerbi-refresh-data/

Page 5: Montreal PowerBI User Group - Realtime Power BI Dashboards
Page 6: Montreal PowerBI User Group - Realtime Power BI Dashboards
Page 7: Montreal PowerBI User Group - Realtime Power BI Dashboards
Page 8: Montreal PowerBI User Group - Realtime Power BI Dashboards
Page 9: Montreal PowerBI User Group - Realtime Power BI Dashboards

*Cloud data is refreshed automatically about every fifteen minutes

Cloud

Page 10: Montreal PowerBI User Group - Realtime Power BI Dashboards
Page 11: Montreal PowerBI User Group - Realtime Power BI Dashboards

Desktop Web

Page 12: Montreal PowerBI User Group - Realtime Power BI Dashboards

Real-Time Dashboards

Stream Analytics

Page 13: Montreal PowerBI User Group - Realtime Power BI Dashboards

Stream Analytics

Stream Analytics

Page 14: Montreal PowerBI User Group - Realtime Power BI Dashboards

Azure Stream Analytics• Highly scalable service for analyzing data in motion• Supports SQL-like query language for data analysis• Scales using Streaming Units (1 SU ~= 1 MB/sec)

Event Hubs

Blob StoragePower BIAzure SQL Database

Event Hubs

Other Output SinksStream Analytics

IoT Hubs

Page 15: Montreal PowerBI User Group - Realtime Power BI Dashboards

Stream Analytics at Work

Page 16: Montreal PowerBI User Group - Realtime Power BI Dashboards

Stream Analytics Query Language• SQL-like language for querying live data streams• Subset of T-SQL• Supports bigint, float, nvarchar(max), datetime, record, and

array• Supports SELECT, FROM, WHERE, GROUP BY, and other

common Data Manipulation Language (DML) statements• Supports COUNT, AVG, DATEDIFF, and other common functions

• Adds extensions such as TIMESTAMP BY and System.Timestamp• Supports temporal grouping of events via "windowing"

Page 17: Montreal PowerBI User Group - Realtime Power BI Dashboards
Page 18: Montreal PowerBI User Group - Realtime Power BI Dashboards
Page 19: Montreal PowerBI User Group - Realtime Power BI Dashboards

Querying a Data Stream• List all Connecticut

cars that enter a toll booth, and include the entry time, toll booth ID, and license-plate number

SELECT EntryTime, TollId, LicensePlateFROM EntryDataWHERE State = 'CT'

Page 20: Montreal PowerBI User Group - Realtime Power BI Dashboards

Designating a Field as the Event Time

• Designate the EntryTime field as the event time for calculations that involve event time

SELECT System.Timestamp AS [Entry Time], TollId, LicensePlateFROM EntryData TIMESTAMP BY EntryTimeWHERE State = 'CT'

Page 21: Montreal PowerBI User Group - Realtime Power BI Dashboards

Windowing• Count or aggregate events over a specified time period

TumblingWindow

HoppingWindow SlidingWindow

Page 22: Montreal PowerBI User Group - Realtime Power BI Dashboards

TumblingWindow

How many red cars go through my toll booths every 5 minutes?

TumblingWindow

Page 23: Montreal PowerBI User Group - Realtime Power BI Dashboards

HoppingWindow

Tell me once a minute how many red cars go through my toll booths every 5 minutes.

HoppingWindow

Page 24: Montreal PowerBI User Group - Realtime Power BI Dashboards

SlidingWindow

During which 5-minute time periods do 10 or more red cars go through my toll booths?

SlidingWindow

Page 25: Montreal PowerBI User Group - Realtime Power BI Dashboards

Using TumblingWindow

• How many New York cars enter a toll booth every 5 minutes?

SELECT DateAdd(minute, -5, System.TimeStamp) AS [Start Time], System.TimeStamp AS [End Time], COUNT(*)FROM EntryData TIMESTAMP BY EntryTimeWHERE State = 'NY'GROUP BY TumblingWindow(minute, 5)

Page 26: Montreal PowerBI User Group - Realtime Power BI Dashboards

Using HoppingWindow

• What is the average wait time at all toll booths for the last 5 minutes, updated every 1 minute?

SELECT DateAdd(minute, -5, System.TimeStamp) AS [Start Time], System.TimeStamp AS [End Time], AVG(DATEDIFF(minute, EN.EntryTime, EX.ExitTime)) AS [Average Wait Time]FROM EntryData EN TIMESTAMP BY EntryTimeJOIN ExitData EX TIMESTAMP BY ExitTime ON EN.TollId = EX.TollId AND EN.LicensePlate = EX.LicensePlate AND DATEDIFF(minute, EN, EX) BETWEEN 0 AND 60GROUP BY HoppingWindow(minute, 5, 1)

Page 27: Montreal PowerBI User Group - Realtime Power BI Dashboards

Using SlidingWindow

• In which 5-minute windows does at least one Connecticut car enter a toll booth?

SELECT DateAdd(minute, -5, System.TimeStamp) AS [Start Time], System.TimeStamp AS [End Time], TollId, COUNT(*) FROM EntryData TIMESTAMP BY EntryTimeWHERE State = 'CT'GROUP BY TollId, SlidingWindow(minute, 5)HAVING COUNT(*) > 0

Page 28: Montreal PowerBI User Group - Realtime Power BI Dashboards

DEMO

Page 29: Montreal PowerBI User Group - Realtime Power BI Dashboards

Power BI REST API

Page 30: Montreal PowerBI User Group - Realtime Power BI Dashboards

REpresentationalStateTransfer

Page 31: Montreal PowerBI User Group - Realtime Power BI Dashboards

Power BI REST API - Workflow

Page 32: Montreal PowerBI User Group - Realtime Power BI Dashboards

1-Create a streaming dataset

Page 33: Montreal PowerBI User Group - Realtime Power BI Dashboards

2-Define the structure

• Text• Number• DateTime

Page 34: Montreal PowerBI User Group - Realtime Power BI Dashboards

3-Save the data?

Page 35: Montreal PowerBI User Group - Realtime Power BI Dashboards

4-Give this to the developer

JSON sample

URL and Key

Page 36: Montreal PowerBI User Group - Realtime Power BI Dashboards

5-Add tiles to your dashboard

Page 37: Montreal PowerBI User Group - Realtime Power BI Dashboards

Direct support for PubNub

Page 38: Montreal PowerBI User Group - Realtime Power BI Dashboards

Microsoft Flow support

<no></code>

Page 39: Montreal PowerBI User Group - Realtime Power BI Dashboards

DEMO

Page 40: Montreal PowerBI User Group - Realtime Power BI Dashboards

Witch one to choose?

Stream Analytics

Page 41: Montreal PowerBI User Group - Realtime Power BI Dashboards

Witch one to choose?

Stream Analytics

Page 42: Montreal PowerBI User Group - Realtime Power BI Dashboards
Page 43: Montreal PowerBI User Group - Realtime Power BI Dashboards

Stream Analytics• Large volumes of data• Highly scalable

• Each streaming unit corresponds to 1MB/second of throughput• Up to 48 units (contact support for more)

• Max rows operations in Power BI• Free plan: 10,000 rows per hour• Paid plan: 1,000,000 rows per hour

• Complex scenarios• Ability to transform the data before sending it • Sources: Event Hub, IoT Hub and Blob Storage• Data sent to Power BI is stored only if Historical Data is selected

Page 44: Montreal PowerBI User Group - Realtime Power BI Dashboards

Power BI• Smaller volumes of data• Simpler scenarios• Max rows operations in Power BI• Free plan: 10,000 rows per hour• Paid plan: 1,000,000 rows per hour

• Easy to write clients in any language• REST API• Data sent to Power BI is stored only if Historical Data is

selected

Page 45: Montreal PowerBI User Group - Realtime Power BI Dashboards

Power BI REST API limitations• To POST Rows

• 75 max columns• 75 max tables• 10,000 max rows per single POST rows request• 1,000,000 rows added per hour per dataset• 5 max pending POST rows requests per dataset• 120 POST rows requests per minute per dataset• If table has 250,000 or more rows, 120 POST rows requests per hour per dataset• 200,000 max rows stored per table in FIFO dataset• 5,000,000 max rows stored per table in ‘none retention policy’ dataset• 4,000 characters per value for string column in POST rows operation

• POST Rows operation per Power BI plan• Dataset created by user with free service plan: 10,000 rows added per hour per dataset• Dataset created by user with paid service plan: 1,000,000 rows added per hour per dataset

• If a user exceeds this limit, we will fail subsequent API calls with the following details:• HTTP Status Code: 429 Too Many Requests

Page 46: Montreal PowerBI User Group - Realtime Power BI Dashboards

Thanks!Guy BarretteMVP Azure, Freelance Dev/Architecthttp://guy.cloud