bpa-rules

Generate and validate Best Practice Analyzer rules for Power BI semantic models.

6|3|Updated Jul 4, 2026
One-click install
npx skills add https://github.com/InsightfulAnalytics/PBI_Agentic_Dev --skill bpa-rules-insightfulanalytics
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: bpa-rules
Source: https://github.com/InsightfulAnalytics/PBI_Agentic_Dev/tree/main/plugins/tabular-editor/skills/bpa-rules
Command: npx skills add https://github.com/InsightfulAnalytics/PBI_Agentic_Dev --skill bpa-rules-insightfulanalytics

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Creating Best Practice Analyzer (BPA) rules for Tabular Editor and Power BI semantic models requires deep knowledge of Dynamic LINQ expressions, TOM properties, and strict Tabular Editor file format requirements, which makes manual rule authoring slow and error-prone. ## Core Features & Use Cases - Interactive Rule Discovery: Conducts a guided double-diamond Q&A workflow to gather organizational context, investigate the actual semantic model (via Fabric CLI, PBIP/TMDL files, or model.bim), and recommend prioritized rule categories before generating anything. - Expert Rule Authoring: Generates tailored BPA rules with correct scopes, severities, expressions, and optional FixExpressions, following Tabular Editor compatibility requirements (CRLF line endings, valid scope names, strict JSON format). - Rule Auditing and Validation: Audits existing BPA rules across all sources (built-in, URL, model-embedded, user, machine) and validates rule files against a JSON schema with an auto-fix script. - Use Case: A BI team lead wants to enforce naming conventions and metadata standards across their Fabric semantic models. The skill interviews them about team standards, inspects the model's TMDL files, then produces a validated BPARules.json ready to load into Tabular Editor 3. ## Quick Start Ask the agent to create BPA rules for your semantic model, for example by saying you want to set up Best Practice Analyzer rules for your team and pointing it to your PBIP definition folder.

Frequently Asked Questions about bpa-rules

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create BPA rules for Tabular Editor?▼

Define rules as JSON objects with ID, Name, Severity, Scope, and a Dynamic LINQ Expression that returns true for violating objects. This skill guides you through requirements gathering, model investigation, and rule generation, then validates the output file for Tabular Editor compatibility.

How do I audit existing BPA rules across all sources?▼

Run the bpa_rules_audit.py script against your model path to discover rules from built-in collections, URLs, model-embedded annotations, user-level, and machine-level files. It outputs an ASCII report and supports JSON export with the --json flag.

Why does my BPA rule file show empty rules in Tabular Editor?▼

Tabular Editor on Windows requires CRLF line endings and rejects files with Unix LF endings, _comment fields, or extra properties like ErrorMessage. Run validate_rules.py with the --fix flag to convert line endings and remove invalid fields automatically.

What scope values are valid in BPA rule expressions?▼

Valid scopes come from the Tabular Editor RuleScope enum, including Model, Table, Measure, DataColumn, CalculatedColumn, Relationship, ModelRole, and Partition. Common mistakes like Role or DataSource must be written as ModelRole and ProviderDataSource or StructuredDataSource.

Can BPA rules automatically fix violations in a semantic model?▼

Yes, rules can include a FixExpression that modifies properties or deletes objects, such as setting IsHidden = true or DataType = DataType.Decimal. FixExpressions should be tested carefully since actions like Delete() permanently remove objects from the model.

How do I embed BPA rules directly in TMDL files?▼

Use the BestPracticeAnalyzer annotation containing the rule JSON array, BestPracticeAnalyzer_IgnoreRules to suppress specific rule IDs, or BestPracticeAnalyzer_ExternalRuleFiles to reference rule URLs. The references/tmdl-annotations.md file documents all annotation patterns.