🚨 How to Do Anomaly Detection in Power BI (No External Tools Needed!)
- Isabelle Bittar
- Aug 9
- 1 min read
A hands-on case study using Python and Isolation Forest — run entirely inside Power Query to flag suspicious employee expenses.

🎁PBIX available at the end of this article!
Introduction
Anomaly detection is a powerful technique that helps organizations spot irregular patterns in their data — especially when they’re trying to identify and localize problems early to take corrective action. There are so many practical use cases: flagging suspicious employee timesheets, detecting inventory spikes or drops, monitoring website or app traffic — you name it.
In a recent HR project I worked on, the goal was to catch potentially suspicious employee expenses — think unusually high meal costs, duplicate entries, or charges submitted outside of typical business hours.
For this project, I was working with a log of expense data that included details like the date and time of each transaction, payment method, vendor, and expense category. I used Python inside Power Query to build an anomaly detection model using the Isolation Forest algorithm from scikit-learn—a popular machine learning library in Python
Here’s a short demo of the dashboard:
In this article, I’ll walk you through how I built it.
Read the full article on Medium: https://medium.com/the-bi-corner/how-to-do-anomaly-detection-in-power-bi-no-external-tools-needed-b12973e58b2b