Quando Algo Importante Acontecer, Ficará a Saber — Instantaneamente

Alert! This is happening — and you need to act now.

Forget waiting for the next management meeting or the weekly report. This alert system monitors your most critical KPIs continuously — and notifies you the moment something important happens. It doesn’t rely on traditional reporting cycles or slow decision-making processes. Instead, it acts in real time — using DAX logic in Power BI and automated flows in Power Automate — to bring the right information to the right person, at the right time.

But it doesn’t stop there. With AI assistance, the system can go one step further: suggesting possible actions based on the situation. Should you call a supplier? Freeze expenses? Review a campaign? The system can help you decide — and even notify your team with a clear, contextual message.

It’s more than alerts. It’s a smart layer of proactive intelligence embedded in your daily operations.

🧘 Balance and Mental Clarity

These alerts are not meant to overwhelm you. On the contrary — they are designed to protect your focus and peace of mind.

Besides critical alerts, this system also sends gentle, occasional reminders that everything is going well. Just a short message to say: “All your key metrics are within safe thresholds.” These notifications help build trust in the system and reassurance in your leadership.

They are also meant to support you with having a systematic approach to management.

After all, the role of real-time data is not just to warn — it’s to support better decisions with clarity, confidence, and respect for your time.

Practical Scenarios Where KPI Alerts Make a Difference

1. Sales Are Dropping — Act Before the Month Ends

Your weekly sales pace just fell below 80% of the expected target. Without real-time monitoring, this would only show up in next month’s report — too late.

The alert is triggered by a DAX measure that compares actual sales with forecasted values. Power Automate sends you a push notification: “Sales in the North region are 22% behind target. Click here to review.”

Immediate actions might include: reviewing campaigns, checking for stockouts, or contacting the sales team.

2. Inventory Below Safety Stock — Prevent a Stockout

You’ve defined minimum safety levels for your most critical products. When inventory drops below that threshold, Power BI flags it — and triggers an alert.

Power Automate then notifies both procurement and operations, with a message like: “Item #AX-305 is below safety stock. Current: 24 | Minimum: 50.”

This allows immediate replenishment, preventing lost sales or production stoppages.

3. Customer Churn Rate Spikes — Retain Key Clients

A sudden increase in customer churn rate may signal dissatisfaction, competition, or internal service issues.

Power BI tracks churn over rolling periods. When the 7-day average exceeds the historical baseline, an alert is sent: “Churn alert: Last 7 days = 5.2% | Expected = 2.8%.”

This could trigger a review of client accounts, support tickets, or NPS survey feedback — with the goal of stopping the bleeding before it escalates.

4. Budget Consumption Over 90% — Control Expenses Now

Your marketing team has already spent 91% of this month’s budget — but we’re only on day 20.

DAX measures monitor budget execution vs. time progression. When consumption exceeds the expected pace, a warning is sent: “Marketing budget at 91%. Month completion: 66%.”

This gives managers a chance to freeze spend, reprioritize campaigns, or request an early budget review.

Dataset Overview: Daily Budget Tracking

This dataset simulates daily budget tracking for five different teams during August 2025. It is intended for creating real-time budget alerts in Power BI using DAX and Power Automate.

Key Fields

Coluna Descrição
Team Name of the team (e.g., Marketing, Sales, IT…)
Data Calendar date from August 1st to 31st
Budget (€) Daily allocated budget (monthly total / 31 days)
Actual (€) Amount actually spent by the team on that day

Purpose

The goal is to track budget execution over time and trigger alerts when:

  • Actual spend exceeds 90% of the total monthly budget
  • …and less than 90% of the month has passed
  • …and at least 4 business days have already passed

This last condition ensures that alerts are only triggered when there is enough data to justify action — avoiding early false positives during the first few days of the month.

Power BI calculates these thresholds with DAX, while Power Automate is used to deliver alerts via email or push notification.

📐 DAX Logic for Instant Budget Alerts

After importing the CSV file into Power BI Desktop, we created two key tables:

  1. Daily_Budget_Dataset — with daily budget and actual values by team
  2. Calendar — a date table generated with DAX that includes a flag for business days

These DAX measures allow us to track budget execution over time, compare it to calendar progress, and trigger alerts with context-aware rules.

🗓️ Calendar Table with Business Day Flag

We used CALENDARAUTO() to generate a dynamic calendar, and added a column to identify business days:

Calendar = 
ADDCOLUMNS(
    CALENDARAUTO(), 
    "IsBusinessDay", NOT(WEEKDAY([Date]) = 1 || WEEKDAY([Date]) = 7)
)

This marks Monday to Friday as business days (IsBusinessDay = TRUE), which we later use to avoid triggering alerts too early in the month.

📈 Core Measures

  • Actual — total actual expenses:
    Actual = SUM('Daily_Budget_Dataset'[Actual (€)])
  • Actual MTD — month-to-date actuals:
    Actual MTD = TOTALMTD([Actual], 'Daily_Budget_Dataset'[Date])
  • Budget — total daily budget:
    Budget = SUM('Daily_Budget_Dataset'[Budget (€)])
  • Budget MTD — accumulated monthly budget:
    Budget MTD = TOTALMTD([Budget], 'Daily_Budget_Dataset'[Date])
  • % Budget Used MTD — execution ratio:
    % Budget Used MTD = DIVIDE([Actual MTD], [Budget MTD])
  • % Month Completed — how far we are into the month:
    % Month Completed = DIVIDE(DAY(TODAY()), DAY(EOMONTH(MAX('Daily_Budget_Dataset'[Date]), 0)))
  • Business Days Passed — working days passed this month:
    Business Days Passed = Business Days Passed = CALCULATE(COUNTROWS('Calendar'), FILTER('Calendar', 'Calendar'[Date] >= EOMONTH(TODAY(), -1) + 1 && 'Calendar'[Date] <= TODAY() && 'Calendar'[IsBusinessDay]))
  • Budget Alert Trigger — main logic for alerts:

    Budget Alert Trigger = IF(
    NOT ISBLANK([% Budget Used MTD]) &&
    NOT ISBLANK([% Month Completed]) &&
    [Business Days Passed] >= 4 &&
    [% Budget Used MTD] > 1 &&
    [% Budget Used MTD] > [% Month Completed],
    1,
    0
    )
  • Budget Alert Message — optional label for dashboards:
    Budget Alert Message = IF([Budget Alert Trigger] = 1, "⚠️ Budget alert triggered", BLANK())

This setup can be reused for other KPIs — such as sales performance, inventory levels, or churn rate — and forms the foundation of a real-time KPI alert system integrated with Power Automate.

📊 Exploring the Data with Month-to-Date Analytics

Once the DAX model was complete, we began exploring the data visually. While the daily view (Actual vs. Budget per day) helps detect spikes or operational anomalies.

We quickly found that a Month-to-Date perspective gives a much clearer understanding of overall budget execution:

With the MTD line charts, it becomes immediately obvious which departments are spending faster than planned. For example, the IT and Marketing teams show an early divergence between Actual MTD e Budget MTD, revealing overspending patterns that may require attention.

This aggregated approach filters out day-to-day noise and highlights meaningful trends — making it easier to spot budget risks before the end of the month.

📈 Why % Budget Used Is So Effective

The final chart shows the evolution of % Budget Used MTD for each department. This indicator is particularly effective because it normalizes the analysis across teams with very different budgets. Whether a team has a daily budget of €200 or €2,000, this measure always reflects how close they are to exhausting their monthly allocation.

A value of 1.0 means the team is perfectly on track. Values above 1.0 indicate overspending, and values significantly below may signal underutilization or delayed execution. It’s a simple, powerful metric — especially when combined with time and alerts.

We could also summarize the budget control tracker up to today (I’m writing this on August, the 6th) as follows:

As you may see, with the defined logic, we have an alert for the HR department! The team has spent €7.994,42 up to today, which is slightly above the budget of €7.931,04. We need to inform the team!

Before implementing the alert system in Power Automate, we can test the logic in Power BI Desktop using the following DAX query:

EVALUATE
SELECTCOLUMNS (
FILTER (
ADDCOLUMNS (
SUMMARIZE (
'Daily_Budget_Dataset',
'Daily_Budget_Dataset'[Team]
),
"Trigger", [Budget Alert Trigger],
"Used", [% Budget Used MTD],
"Progress", [% Month Completed]
),
[Trigger] = 1
),
"Team", 'Daily_Budget_Dataset'[Team],
"Trigger", [Budget Alert Trigger],
"Used", [% Budget Used MTD],
"Progress", [% Month Completed]
)

This would return the following:

🚀 Publish and Automate with Power BI + Power Automate

Now that our logic is working and tested locally, the next step is to publish the report to Power BI Service. This enables scheduled refresh and cloud-based access to your data model.

Once published, we create a new flow in Power Automate using the “Run a query against a dataset” action from the Power BI connector. This flow will:

  1. Run the DAX query that checks which teams triggered alerts
  2. Loop through the results
  3. Send a push notification or email to the relevant manager (or group)

This means you can automate real-time budget monitoring — and alert decision-makers the moment a risk is detected.
You’re no longer relying on monthly reports or manual follow-ups. The system becomes your assistant, running quietly in the background and only reaching out when action is required.

In the next section, we’ll walk through the full flow in Power Automate, step by step.

✅ One Alert per Day, Not One per Hour

We’ve set the flow to run once per hour — this ensures fast reaction to any new alert conditions. But we also want to avoid annoying users with repeated notifications.

Here’s how we manage this:

  • We create a SharePoint list (or Dataverse table) to log sent alerts. Each record includes:
    • Team name
    • Date of alert
    • Optional message content
  • Before sending a new notification, the flow checks whether an alert has already been sent today for that team.
  • If no record exists, it proceeds to notify — and logs the alert for that day.
  • If a record already exists, no action is taken.

This ensures peace of mind: no duplicate messages, no flooding — just one smart nudge per day, per team, when it matters.

You can even extend this logic to send a “status OK” message once per day when no alert is triggered, creating a rhythm of calm, transparent communication.

So, the flow would look like this

The trigger:

The DAX query:

The alert system:

Each of the compose actions is meant to facilitate the extraction of the items we want to analyze from the dataset:

@{item()?['[Team]']}
@{item()?['[Used]']}
@{item()?['[Progress]']}
@{item()?['[Trigger]']}

The first condition would look like this:

It checks if the value of trigger is equal to 1:

@{outputs('Compose_Trigger')}

If it is, it will send the push notification to the user:

⚠️ Budget alert – Team @{outputs('Compose_Team')} has used @{outputs('Compose_Used')}% of the budget, with only @{outputs('Compose_Progress')}% of the month completed.

Note that this could be improved. I’m sending this notification to myself, but, in production, this could be someone else.

The second condition is triggered if there are no alerts for a given day. We want to send a gentle reminder that everything’s under control. We could do it once a week, for example, on Mondays. So, the condition would be:

@{dayOfWeek(utcNow())}

If it is, we send a smooth notification:

✅ Everything looks good – All teams are operating within their budget. No action needed.

 

 

This is how you move from passive reporting to active management. Alerts are not just data — they are decisions waiting to happen.

Partilhe o seu amor
Nuno Nogueira
Nuno Nogueira
Artigos: 36

Deixe um comentário

Your email address will not be published. Required fields are marked *