In my previous post, I explained how you could create variable thresholds in Power BI for your alerts. In this post, I will explain how you could notify your whole team that something is wrong. For example, if you are working with a data warehouse and want to inform your team that the latest data load has failed, so the current data isn’t up-to-date.
In this post, I will continue with my CPU alert, and I will use the following software to inform my team:
- Power BI Dashboard (to create my alert)
- Adaptive Card designer (to design my alert)
- Power Automate (to send my alert)
- Teams (to receive my alert)
I have to thank Chris Webb who described this idea!
At the end of my previous post, we created an alert for when my CPU was above the average, plus five more. We will use this alert in Power Automate. We create a new Automated cloud flow, give it a name, and chose the flow’s trigger: When a data driven alert is triggered.
In the next screen, we can choose which alert will be our trigger. This is our CPU HIGH!, which we created for our IsAboveAverageThreshold:
After that, we chose the next action. Because we want to inform our team, we decide to post to a channel, and not a person. This could be useful if you only want to inform the admin for example.
I created a team, especially for this demo, where it will send the alerts to:
It only has one channel, so it will send this to General.
Now comes the important part: Building the message! Before we go to the Adaptive Card designer I would advise to already fill in these values:
You can then copy them to the designer. If you paste them you get this as a result. You can use them for your card.
In the designer, you can create your own JSON cards. For this example, we create a very basic card with Title, Threshold Value, Actual value, and a URL to the dashboard. I also added two pictures of a CPU and the Power BI Logo. I added my full JSON below:
If you copied this code (or, created your own of course) we go back to Power Automate. Here you paste the JSON into the message box. It shows us the following:
The values are already filled correctly. And that’s it! Time to test!
As soon as my card gives me an alert, the flow gets triggered and will complete the next action: Sending a card to a Teams Channel. In Teams, I get the following message:
Unfortunately, it’s not possible to show the current values or the values at that time, because it only saves information from the card. And our card uses a measure that looks at two different measures, to make the threshold variable. In this case, I wouldn’t add the value and threshold, but I would just give my team members an informational card, saying that something is wrong (in my case the CPU).