In the previous article and video, I explained a method that you can use to have real-time calculations in a Power BI streaming dataset. The calculations done that way are limited though because it is using the Q&A feature of Power BI. If you are after a complex calculation then DAX can definitely help. In this article and video, I’ll explain a method that you can use to write DAX measures on a Power BI streaming dataset.
What is a streaming dataset?
In Power BI, you can have a dataset with Imported data, DirectQuery, Live Connection, or Composite mode. You can build all of those types of Power BI datasets in the Power BI Desktop. However, there is a single type of dataset, which you can only build through the service, called the Streaming dataset.
A streaming dataset is for building reports with real-time response time. For example, if you want to build a Power BI dashboard that shows the room temperature as soon as captured by a temperature sensor. For this type of dataset, you send the data rows using Power BI REST API, which can be called using a custom C# application, or PowerShell scripts, or even from a Power Automate flow process.
Streaming dataset can be only created using Power BI service.
The fields in an streaming dataset will be defined in the service too. And all of the fields will be under one table.
This is not a post about how to create a streaming dataset, You can read more about it here.
No Power BI Desktop
The big development problem with the streaming dataset is that you don’t have a PBIX file. You cannot open this solution in Power BI Desktop. And as a result, you will loose the ability to bring other datasets, modify and edit the data using Power Query, and write calculations using DAX.
The download option is not even available from the dataset.
Live Connection to the streaming dataset
If the calculation you are after is a complex dynamic calculation, then you can write DAX expressions for it. This can be done using a live connection to the streaming dataset using Power BI Desktop:
The streaming dataset can be used as the source of live connection.
This would create a live connection to the streaming dataset.
When the live connection is created, you can write DAX measures either using normal measures or quick measures.
Would it be real-time?
One important consideration here is that the report generated this way, wouldn’t be a real-time report or dashboard. This would be a live connection to the real-time dataset. Which means any dashboard created on top of it would be refreshed with the frequency that can be set at the dashboard level. And every time you browse the report, you will have the report from the data at that moment.
DirectQuery to the streaming dataset: Even more flexibility
The ability to write measures is great. However, sometimes, you want to create columns too, and maybe bring another data table to combine with this data. With the new feature released named as DirectQuery to Power BI dataset, you can do this.
You can have a table as the DirectQuery connection to the streaming Power BI dataset, this will give you the ability to bring other data tables as imported and have a more complete solution.
To learn more about how the DirectQuery to Power BI dataset works, read my article here.
Q&A for simple real-time calculations
A reminder of my previous article here that if you are looking for a calculation for your real-time dashboard and the calculation is simple, you can use Q&A feature in the report. Read more about it here;