Automatically invoke this skill whenever the user asks about Fabric tenant settings or Power BI tenant settings or auditing tenant settings. You can use this skill if the user mentions "Fabric administration".
日本語の概要は準備中です。原文の説明を表示しています。
R visual creation and ggplot2 patterns for PBIR reports. Automatically invoke when the user mentions "R visual", "ggplot2", "ggplot in Power BI", or asks to "create an R visual", "add an R chart", "write an R visual script", "inject an R script into Power BI".
インストール方法を見るインストールする前に、エージェントに与えられる指示の中身を確認できます。
Use
pbirfor every report mutation. Read PBIR metadata only for diagnosis. Ifpbiris unavailable or lacks an operation, stop and report the gap; never edit report JSON directly.
R visuals execute R scripts (primarily ggplot2) to render static PNG images on the Power BI canvas. ggplot2 is the preferred library -- its grammar of graphics approach produces clean, publication-quality statistical visualizations with less code. R is particularly strong for statistical visualizations.
scriptVisualValues (columns and measures, multiple allowed)dataset (data.frame, auto-injected)pbir add visual scriptVisual "Report.Report/Page.Page" --name RevenueByDateR \
--data "Values:Sales.Date" --data "Values:Sales.Revenue"
library(ggplot2)
p <- ggplot(dataset, aes(x=Date, y=Sales)) +
geom_col(fill="#5B8DBE") +
theme_minimal(base_size=12) +
theme(panel.grid.major.x=element_blank())
print(p) # MANDATORY for ggplot2
Critical rules:
print(p) is mandatory for ggplot2 objects -- they do not auto-display in Power BIdataset is auto-injected as a data.frame; do not create itdataset[,1]) to avoid name escaping issuesdataset$`Order Lines`Before presenting the script to the user, dispatch the r-reviewer agent to validate correctness and provide design feedback.
pbir visuals r "Report.Report/Page.Page/RevenueByDateR.Visual" --script-file chart.r
The CLI handles PBIR string escaping.
pbir visuals bind "Report.Report/Page.Page/RevenueByDateR.Visual" --show
pbir validate "Report.Report" --all
For read-only diagnosis, scripts are stored in visual.objects.script[0].properties:
{
"source": {"expr": {"Literal": {"Value": "'library(ggplot2)\\n...\\nprint(p)'"}}},
"provider": {"expr": {"Literal": {"Value": "'R'"}}}
}
Identical structure to Python visuals except visualType is scriptVisual and provider is 'R'.
| Package | Version | Purpose |
|---|---|---|
| ggplot2 | 3.5.1 | Grammar of graphics |
| dplyr | 1.1.4 | Data manipulation |
| tidyr | 1.3.1 | Data tidying |
| ggrepel | 0.9.5 | Non-overlapping labels |
| patchwork | 1.2.0 | Compose multiple plots |
| cowplot | 1.1.3 | Publication-quality plots |
| corrplot | 0.94 | Correlation matrices |
| viridis | 0.6.5 | Color scales |
| RColorBrewer | 1.1-3 | Color palettes |
| forecast | 8.23.0 | Time series forecasting |
| pheatmap | 1.0.12 | Heatmaps |
| treemap | 2.4-4 | Treemaps |
| lattice | 0.22-6 | Trellis graphics |
~1000 CRAN packages available. Not supported: packages requiring networking (RgoogleMaps, mailR).
Full package list: https://learn.microsoft.com/power-bi/connect-data/service-r-packages-support
Any locally installed R package works without restriction. R must be installed separately.
print(p) -- ggplot2 objects require explicit printingif (nrow(dataset) == 0) { plot.new(); text(0.5, 0.5, "No data") }dataset[,1] avoids name escaping issuestheme_minimal() -- clean aesthetic that works well with Power BIfactor()plot.margin=margin(t, r, b, l) to prevent clipping| Constraint | Desktop | Service |
|---|---|---|
| Output | Static PNG, 72 DPI | Static PNG, 72 DPI |
| Timeout | 5 minutes | 1 minute |
| Row limit | 150,000 | 150,000 |
| Output size | 2 MB | 30 MB |
| Networking | Unrestricted | Blocked |
| Gateway | Personal only | Personal only |
| Cross-filter FROM | Not supported | Not supported |
| Receive cross-filter | Yes | Yes |
| Publish to web | Not supported | Not supported |
| Embed (app-owns-data) | Not supported | Not supported |
library(ggplot2)
# 1. Guard against empty data
if (nrow(dataset) == 0) {
plot.new()
text(0.5, 0.5, "No data available", cex=1.5)
} else {
# 2. Data preparation (index-based access)
df <- data.frame(
category = dataset[,1],
value = dataset[,2]
)
# 3. Create visualization
p <- ggplot(df, aes(x=reorder(category, -value), y=value)) +
geom_col(fill="#5B8DBE", width=0.7) +
theme_minimal(base_size=12) +
theme(
panel.grid.major.x = element_blank(),
axis.title = element_blank()
)
# 4. Render
print(p)
}
For the language-choice decision, see the "When to Use a Script Visual" section above. This table covers only mechanical syntax differences for scripts already committed to R:
| Aspect | R (scriptVisual) | Python (pythonVisual) |
|---|---|---|
| Render call | print(p) | plt.show() |
| Column access | dataset[,1] or dataset$col | dataset.iloc[:,0] or dataset["col"] |
| Empty guard | if (nrow(dataset) == 0) | if len(dataset) == 0: |
| Factor/category order | factor(x, levels=...) | pd.Categorical(x, categories=...) |
| Runtime (Service) | R 4.3.3 | Python 3.11 |
Reach for an R visual only when all of the following hold:
If interactivity or cross-filtering matters, use Deneb (a static PNG cannot be a selection source). If the need is a small inline mark (sparkline, bar, status pill), use an SVG measure (no row cap, no timeout, no licensing/region gate, renders under publish-to-web). The script visual's niche is narrow: compute-at-render statistical plots for internal or org consumption.
R vs Python once a script visual is the right call: use R for publication-quality statistical defaults and packages with no Python peer (forecast, corrplot, pheatmap, ridgeline/violin). Use Python when the computation leans on scikit-learn, statsmodels, or scipy, or when surrounding report logic is already Python. Where equal, default to whichever language the report's other scripts use; mixing doubles the publish-time package surface to validate.
Do not default to a script visual because a chart type "looks statistical." A box plot, lollipop, or dumbbell is an SVG-measure or Deneb job; reserve scripts for charts that genuinely compute.
references/data-model.md -- dataset grouping mechanic, row/byte caps, forcing per-row input, and R-specific traps (Time type, text rendering flags, CJK fonts)references/community-examples.md -- R Graph Gallery examples organized by chart type (distribution, correlation, ranking, evolution, flow)references/ggplot2-patterns.md -- Common ggplot2 chart patterns (bar, donut, line, heatmap, bullet)examples/script/ -- Standalone R scripts (bar-chart, trend-line) -- ready to inject into visual.json after escapingexamples/visual/bullet-chart.json -- PBIR visual.json: bullet chart with conditional coloring, error handling, and extensive escapingexamples/visual/bar-chart.json -- PBIR visual.json: horizontal bar with PY comparison lines and colored account labelsexamples/visual/trend-line.json -- PBIR visual.json: area chart with ribbon plot and month factor handlingTo retrieve current R visual / package support docs, use microsoft_docs_search + microsoft_docs_fetch (MCP) if available, otherwise mslearn search + mslearn fetch (CLI). Search based on the user's request and run multiple searches as needed to ensure sufficient context before proceeding.
pbi-report-design -- Layout and design best practicespython-visuals -- Python Script visuals (same concept, different language)deneb-visuals -- Vega/Vega-Lite visuals (interactive, vector-based alternative)svg-visuals -- SVG via DAX measures (lightweight inline graphics)pbir-format (pbip plugin) -- PBIR JSON format referenceまだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Automatically invoke this skill whenever the user asks about Fabric tenant settings or Power BI tenant settings or auditing tenant settings. You can use this skill if the user mentions "Fabric administration".
日本語の概要は準備中です。原文の説明を表示しています。
Interactive BPA rule generation for Power BI semantic models; guided discovery, model investigation, and expert rule authoring. Automatically invoke when the user mentions "BPA rule", "Best Practice Analyzer", or asks to "create a BPA rule", "audit BPA rules", "recommend BPA rules", "set up BPA for my team", "check model for best practices", "validate BPA rules", "improve a BPA expression".
日本語の概要は準備中です。原文の説明を表示しています。
Writing and executing C# scripts and macros against Power BI semantic models using Tabular Editor 2/3. Automatically invoke when the user mentions "C# script", "Tabular Editor script", "TOM scripting", "MacroActions.json", "XMLA", or asks to "automate model changes", "bulk update measures", "create calculation groups", "write a macro", "format DAX expressions", "manage model metadata".
日本語の概要は準備中です。原文の説明を表示しています。
TOM and ADOMD.NET guidance via PowerShell for connecting to Power BI Desktop's local Analysis Services instance. Covers model enumeration, DAX queries, metadata modification, annotations, calendar definitions, field parameters, query tracing, DAX library package management (daxlib.org), and the Desktop Bridge for reloading and screenshotting the report canvas. Automatically invoke when the user mentions "Power BI Desktop", "Analysis Services port", "TOM", "ADOMD", "daxlib", "DAX library", "DAX UDF package", or asks to "connect to PBI Desktop", "query PBI Desktop with DAX", "modify PBI Desktop model", "add a measure to PBI", "capture visual queries", "create a field parameter", "validate DAX", "intercept DAX queries", "install daxlib", "add DAX SVG", "add IBCS", "reload the report canvas", "screenshot a report page", "Desktop Bridge", or to work with the model and report in Power BI Desktop together.
日本語の概要は準備中です。原文の説明を表示しています。
Step-by-step workflow for creating complete Power BI reports from scratch using pbir CLI. Covers model discovery, report creation, page layout, theme setup, visual placement, field binding, filtering, formatting, validation, and publishing. Automatically invoke when the user asks to "create a new report", "build a report from scratch", "make a dashboard", "set up a report with KPIs", "create an executive dashboard", "add pages and visuals to a new report".
日本語の概要は準備中です。原文の説明を表示しています。
DAX performance optimization for semantic models. Automatically invoke when the user asks to "optimize DAX", "fix slow DAX", "DAX performance", "tune a measure", "debug a measure", "DAX anti-patterns", or mentions slow queries, server timings, or DAX authoring.
日本語の概要は準備中です。原文の説明を表示しています。