Sending alerts to notify your whole team

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.

Pick the correct trigger
Pick the correct trigger

In the next screen, we can choose which alert will be our trigger. This is our CPU HIGH!, which we created for our IsAboveAverageThreshold:

Select your alert.
Select your alert.

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.

Pick Post your own adaptive card as the Flow bot to a channel (Preview)
Pick Post your own adaptive card as the Flow bot to a channel (Preview)

I created a team, especially for this demo, where it will send the alerts to:

Chose the Team and Channel
Chose the Team and Channel

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:

Picking the dynamic values
Picking the dynamic 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.

JSON code of dynamic values
JSON code of dynamic values

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:

{
"type": "AdaptiveCard",
"body": [
{
"type": "ColumnSet",
"separator": true,
"columns": [
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "Image",
"url": "https://powerbi.microsoft.com/pictures/application-logos/svg/powerbi.svg",
"altText": "Power BI",
"size": "Small"
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "Image",
"url": "https://www.flaticon.com/premium-icon/icons/svg/1892/1892518.svg",
"size": "Small",
"horizontalAlignment": "Right"
}
]
}
]
},
{
"type": "TextBlock",
"text": "Power BI Alert",
"weight": "Bolder"
},
{
"type": "FactSet",
"facts": [
{
"title": "Title",
"value": "@{triggerOutputs()?['body/alertTitle']}"
},
{
"title": "Value",
"value": "@{triggerOutputs()?['body/tileValue']}"
},
{
"title": "Threshold",
"value": "@{triggerOutputs()?['body/alertThreshold']}"
}
]
}
],
"actions": [
{
"type": "Action.OpenUrl",
"title": "Open Power BI",
"url": "@{triggerOutputs()?['body/tileUrl']}"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.2"
}

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:

Json code to fill your adaptive card
Placing the values

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:

Adaptive Card in Teams
Alert in teams

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).

Take care.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this:
search previous next tag category expand menu location phone mail time cart zoom edit close