Streaming data sets in Power BI are a cool feature that allows you to analyze data as it occurs. I was playing around with setting up this cool twitter demo using Flow as described here by Sirui: https://powerbi.microsoft.com/en-us/blog/push-rows-to-a-power-bi-streaming-dataset-without-writing-any-code-using-microsoft-flow/ but was thinking, wouldn’t it be cool if I can get alerts based on the data that comes in. For example I want to get an alert when I get more than 20 negative Power BI tweets in the last hour. Unfortunately you cannot create measure at this time to add any logic but there is a way. Let’s take a look.
If you follow the above instruction you will end up with a dataset in Power BI that gets fed tweets and their sentiments real time. One change I made to the flow above is that I turned on “Historic data analysis”
This gives me a dataset that I can build reports on and analyze data in the past similar to a push api dataset, more on this here.
So now I have this dataset I can start creating reports and dashboards (you can also add more data as described here to make things a bit more interesting):
and pin them to your dashboard:
So far so good but now I want to see only the count of tweets with sentiment <= 0.5 in the last hour. Here is where the trouble starts as I can’t express last hour in the report designer. Luckily there is another smart feature that will help us here called Q & A, I can just ask the question.
This immediately gives me the answer I need, just not completely in the right shape as I need this to be a single card, not a chart for data alerts to work. There is also an option for me to change this manually, so in this case I open the viz pane and select card:
Now I pin it to the dashboard and after renaming the tile I have the number of negative tweets in the last hour:
Now as last step I can configure my data alert to send me an alert when I get more then 20 negative tweets in hour:
Done again goes to show you the power of Q&A. Pretty cool scenario and NO code required …