Anomaly detection in Power BI is a built-in feature that can be applied to line charts and time series visuals. Unlike a machine learning model that can be trained in the conventional sense, the Power BI anomaly detection feature applies an automated algorithm to determine whether any anomalies exist based on statistical principles derived from your dataset. However, you do have options for preparing your dataset and fine-tuning your visuals to guide the accuracy and focus of the detection.
Step-by-step approach:
Use a clean, time-series dataset: You must ensure your data is aggregated by time, for instance, daily or weekly. The Analytics pane for anomaly detection is available only when the visual has a time-based x-axis with a single measure on the y-axis.
Control granularity: The model performs best when limited data causes less noise, and high data does not create much sparsity. Change the granularity (e.g., summarize by week instead of day) to facilitate the detection of patterns.
Take out-of-focused filters: Apply slicers or filters to focus the dataset on the relevant segments, metrics, or business contexts. This will allow the model to detect purposeful anomalies without interference from unrelated data.
Add anomaly detection: In the line chart, navigate to the Analytics pane, click Add under Find anomalies, and set the parameters such as Sensitivity and expected range shading.
Customize context: Use Explain the anomaly to get some AI insight into why the anomaly may have occurred, which depends on related fields in your dataset. Ensure that you include additional dimensions such as category and region in the model.