9.3 Advanced Analytics Patterns
Key Takeaways
- R and Python visuals enable advanced statistical analysis and machine learning directly within Power BI reports.
- What-if parameters create sliders that let users explore scenarios by adjusting values dynamically.
- Smart narrative visuals automatically generate text explanations of data patterns and outliers.
- Anomaly detection identifies unexpected values in time-series data and provides possible explanations.
- Combining AI visuals with traditional charts creates a powerful analytical experience for self-service users.
Advanced Analytics Patterns
Quick Answer: Power BI supports advanced analytics beyond standard charts. What-if parameters enable scenario analysis with sliders. Anomaly detection highlights unexpected data points. R/Python visuals run custom statistical code. Combining these techniques with AI visuals creates a comprehensive analytics layer.
What-If Parameters
What-if parameters create dynamic sliders for scenario analysis:
Modeling tab → New Parameter → What If
→ Configure: Name, Data type, Minimum, Maximum, Default, Increment
How It Works
A what-if parameter creates:
- A new table with values from min to max
- A measure returning the selected value
- A slicer for user interaction
Example: Revenue Scenario
// What-if parameter: Growth Rate (0% to 50%, default 10%)
Projected Revenue =
SUM(Sales[Amount]) * (1 + [Growth Rate Value])
Users slide the Growth Rate slider to see how different growth assumptions affect projected revenue.
Common What-If Scenarios
- Price sensitivity — How does a 10% price increase affect revenue?
- Discount impact — What happens if we offer a 15% discount?
- Headcount planning — How many new hires are needed at different growth rates?
- Budget allocation — What is the impact of shifting budget between channels?
Anomaly Detection
For time-series line charts:
Analytics pane → Find Anomalies → Turn On
→ Configure sensitivity (higher = more anomalies detected)
What Anomaly Detection Does
- Builds a statistical model of the expected data pattern
- Identifies points that fall outside the expected range
- Marks anomalies with special indicators on the chart
- Provides explanations for each anomaly (which dimensions contributed)
Anomaly Explanations
Click an anomaly marker to see:
- The expected value vs. actual value
- Which categories deviated most from expectations
- Contributing factors ranked by impact
- Confidence level of the anomaly detection
R and Python Visuals
R Visual
Visualizations → R Script Visual → Add fields → Write R code
# Example: Correlation plot
library(ggplot2)
ggplot(dataset, aes(x=Revenue, y=Profit)) +
geom_point() +
geom_smooth(method="lm")
Python Visual
Visualizations → Python Visual → Add fields → Write Python code
# Example: Distribution plot
import matplotlib.pyplot as plt
import seaborn as sns
sns.histplot(dataset['Revenue'], kde=True)
plt.show()
Limitations of Script Visuals
- Render as images (not interactive)
- Require R/Python runtime installed
- Limited to 150,000 rows of input data
- May not work in the Power BI Service without Premium/Fabric
Combining Analytical Techniques
A comprehensive analytics page might include:
| Visual | Purpose |
|---|---|
| Line chart with anomalies | Identify unexpected data points |
| Key Influencers | Explain what drives the anomalies |
| Decomposition Tree | Drill into root causes |
| What-if slicer | Model different scenarios |
| Narrative visual | Summarize findings in text |
On the Exam
The PL-300 frequently tests:
- Creating and using what-if parameters for scenario analysis
- Configuring anomaly detection on line charts
- Understanding the limitations of R/Python visuals
- Combining multiple analytical features for comprehensive analysis
A financial analyst wants to explore how different growth rate assumptions (5%, 10%, 15%, 20%) affect projected revenue. Which Power BI feature is most appropriate?
Anomaly detection in Power BI works with which type of visual?
What is a key limitation of R and Python visuals in Power BI?