I attended the London Power BI Meetup last night. Guest speaker was Peter Myers On the topic of “Delivering Real-Time Power BI Dashboards With Power BI.” It was a great session.
Peter showed off three mechanisms for streaming data to a real time dashboard:
- The Power BI Rest API
- Azure Stream Analytics
- Streaming Datasets
We’ve done a fair bit at Adatis with the first two and whilst I was aware of the August 2016 feature, Streaming Datasets I’d never got round to looking at them in depth. Now, having seen them in action I wish I had – they are much quicker to set up than the other two options and require little to no development effort to get going – pretty good for demo scenarios or when you want to get something streaming pretty quickly at low cost.
You can find out more about Streaming Datasets and how to set them up here: https://powerbi.microsoft.com/en-us/documentation/powerbi-service-real-time-streaming/
If you create a new Streaming Dataset using ‘API’ as the source, Power BI will provide you with an example PowerShell script to send a single row of data into the dataset. To extend this, I’ve hacked together a PowerShell script and that loops and sends ‘random’ data to the dataset. If you create a Streaming Dataset that matches the schema below, the PowerShell script further below will work immediately (subject to you replacing the endpoint information). If you create a different target streaming dataset you can easily modify the PowerShell script to continually push data into that dataset too.
I’ve shared this here, mainly as a repository for me, when I need it, but hopefully to benefit others too.
Streaming Dataset Schema
Alternative PowerShell Script
Just remember to copy the Power BI end point to the relevant location in the script.
You can find the end point (or Push URL) for the Dataset by navigating to the API Info area within the Streaming Dataset management page within the Power BI Service:
# Initialise Stream $sleepDuration = 1 #PowerBI seldom updates realtime dashboards faster than once per second. $eventsToSend = 500 #Change this to determine how many events are part of the stream $endpoint = "[INSERT YOUR ENDPOINT HERE]" # Initialise the Payload $payload = @{EventDate = '' ; EventValue = 0; EventSource = ''} # Initialise Event Sources $eventSource = @('Source1', 'Source2', 'Source3') # Iterate until $eventsToSend events have been sent $index = 1 do { # Update payload $payload.EventDate = Get-Date -format s $source = Get-Random -Minimum 0 -Maximum 3 $payload.EventSource = $eventSource[$source] $value = Get-Random -Minimum 0.00 -Maximum 101.00 $payload.EventValue = $value # Send the event Invoke-RestMethod -Method Post -Uri "$endpoint" -Body (ConvertTo-Json @($payload)) # Report what has been sent "`nEvent {0}" -f $index $payload # Sleep for a second Start-Sleep $sleepDuration # Ready for the next iteration $index++ } While ($index -le $eventsToSend) # Finished "`n{0} Events Sent" -f $eventsToSend
Introduction to Data Wrangler in Microsoft Fabric
What is Data Wrangler? A key selling point of Microsoft Fabric is the Data Science
Jul
Autogen Power BI Model in Tabular Editor
In the realm of business intelligence, Power BI has emerged as a powerful tool for
Jul
Microsoft Healthcare Accelerator for Fabric
Microsoft released the Healthcare Data Solutions in Microsoft Fabric in Q1 2024. It was introduced
Jul
Unlock the Power of Colour: Make Your Power BI Reports Pop
Colour is a powerful visual tool that can enhance the appeal and readability of your
Jul
Python vs. PySpark: Navigating Data Analytics in Databricks – Part 2
Part 2: Exploring Advanced Functionalities in Databricks Welcome back to our Databricks journey! In this
May
GPT-4 with Vision vs Custom Vision in Anomaly Detection
Businesses today are generating data at an unprecedented rate. Automated processing of data is essential
May
Exploring DALL·E Capabilities
What is DALL·E? DALL·E is text-to-image generation system developed by OpenAI using deep learning methodologies.
May
Using Copilot Studio to Develop a HR Policy Bot
The next addition to Microsoft’s generative AI and large language model tools is Microsoft Copilot
Apr