Real-Time Dashboards on Power BI Sergey Lunyakin
Sponsors
About me BI Developer at ITMagination inc. Leader of Organizer of SQLSaturday in Lviv Contacts: sergey.lunyakin@gmail.com @slunyakin
Agenda Dashboards vs Real-Time (near) Dashboards Real-Time Dashboards in Power BI Power BI REST APIs Using Power BI REST API in your applications Using streaming data source Using non-streaming data source
Dashboards vs Real-Time Dashboards Static Dashboard VS http://blogs.sqlsentry.com/rickpittser/feel-the-power/
Real-Time Monitoring Cases Fraud detection Connected car scenario Click-stream analysis Financial portfolio alerts Smart grid CRM alerting sales with customer scenario Data and identity protection services Sales tracking
Real-Time Dashboards in Power BI https://msdn.microsoft.com/library/mt267603.aspx
Power BI REST API Use REST API for pushing data to Power BI from application Native Client Web application Allows to interact and manage almost all Power BI objects Datasets Tables Dashboards Groups Allows to create (near) real-time dashboards with automatic update
Power BI REST API: Objects Model https://api.powerbi.com/v1.0/myorg /DataSets GET DataSets - List DataSets POST DataSet – Create DataSet POST Table Rows – Add Rows DELETE Table Rows – Delete Rows PUT Table – Update Schema /Groups GET Groups – List groups https://api.powerbi.com/beta/myorg /Reports (Preview) GET Reports - List reports /Dashboards (Preview) GET Dashboards - List dashboards GET Tiles – list tiles GET Tile -get tile Uses Standard technologies REST JSON OAuth Cross-Platform Easy to use
Power BI REST API: Not supported (not yet) Push data into existed dataset Excel, PowerBI Desktop,… Create relations between tables Delete range of rows Delete existed dataset Get data from existed dataset
Demo http://docs.powerbi.apiary.io
Power BI REST API: Workflow https://msdn.microsoft.com/en-us/library/dn877544.aspx
Power BI REST API: Authentication Authenticate application in Azure Active Directory using OAuth2 Create a new user account in Azure AD Add new application on Azure Management Portal https://manage.windowsazure.com Grant application access to Power BI Service and set permissions Get Client ID
Power BI REST API: Authentication process
Power BI REST API: Web authentication process
Power BI REST API: Using in application Authentication in Azure AD Use Microsoft.IdentityModel.Clients.ActiveDirectory Library Install from NuGet Get the token (new or refresh one) Call REST API method specifying the Bearer token in the header Receive JSON answer
Demo Power BI console app
Power BI REST API: Capacity Limits Max number of rows per one request - 10К Total number of rows per hour Power BI free: 10K rows/hour per dataset Power BI Pro ($9.99): 1М rows/hour per dataset Max number of rows per table 5М Depends from retention policy for dataset None – insert up to limit 5М rows, then error basicFIFO – insert up to 200К rows and then start deleting old one Max number of POST requests is 5 per dataset https://msdn.microsoft.com/en-us/library/dn950053.aspx
Streaming data: Event Hub & Azure Stream Analytics Scalable system for processing and visualizing data from devices Azure Event Hub allows to ingest up to millions events per second Has own REST API Azure Stream Analytics allows to run query on top of streaming data. Like StreamInsight or Apache Storm Allows to use Event Hub as source Allows to aggregate data per time periods Allows to send result to outputs. For example Power BI
Demo Azure EventHub & Stream Analytics
Non-streaming data sources Use DirectQuery in Power BI for getting data from Azure SQL/DW On-Premise SSAS Spark on Azure HDInsight You can’t see dynamic updates on charts, but don’t need refresh data source
Summary Real-Time (near) Dashboards on Power BI – it’s possible Power BI REST API – easy and convenience way to do it Get data from Native/Web applications and streaming sources Get data from non-streamed sources
Useful Links Begin with - http://dev.powerbi.com/ Full interactive documentation - http://docs.powerbi.apiary.io/ Examples - https://powerbi.microsoft.com/en-us/documentation/powerbi-developer-overview-of-power-bi-rest-api/ Code examples- https://github.com/PowerBI Code examples David Mauri - https://github.com/yorek/RealTime-PowerBI Azure Stream Analytics integration - https://azure.microsoft.com/en-us/documentation/articles/stream-analytics-power-bi-dashboard/ Limits - https://msdn.microsoft.com/en-us/library/dn950053.aspx SSIS Adapter For PowerBI -https://github.com/nicksav/SSISAdapterForPowerBI
Sponsors
Thank you!