How tabulareditor/bestpracticerules works
1. This repository is not an application runtime; it is a content repository for Tabular Editor’s Best Practice Analyzer. Its main product is a set of JSON rule packs that Tabular Editor loads as model-analysis rules.
2. The top-level packaged artifacts are BPARules-standard.json, BPARules-standard-lax.json, BPARules-contrib.json, and BPARules-PowerBI.json. These are the distributable outputs meant for end users and releases.
3. The source of truth lives under src/standard/, where rules are stored as individual JSON files. This keeps each rule independently reviewable and maintainable rather than editing one large monolithic file.
4. The source rules are organized by analyzer category, which maps directly to the repository’s architecture: DAX Expressions, Formatting, Metadata, Model Layout, Naming Conventions, and Performance. Each category is a logical subsystem of best-practice checks.
5. Every rule follows a shared schema described in the README: ID, Name, Category, Description, Severity, Scope, Expression, optional FixExpression, and optional Remarks. The key execution logic is the Dynamic LINQ Expression, which Tabular Editor evaluates against model objects.
6. The repo’s functional boundary is clear: it does not execute analysis itself. Tabular Editor is the consumer, loading these JSON definitions and applying them to tabular model metadata and DAX expressions inside the model.
7. The build folder contains two PowerShell scripts, combine-rules.ps1 and split-rules.ps1. These indicate a simple packaging pipeline: split a combined ruleset into per-rule files for source control, then combine source files back into release-ready JSON bundles.
8. The standard ruleset appears to be the primary maintained baseline. The presence of standard-lax, contrib, and PowerBI packages suggests multiple curated distributions with different strictness or scope, likely assembled from the same rule-fragment pattern.
9. The rules themselves target different layers of a tabular model: DAX formula quality, metadata behavior, model layout/visibility, naming consistency, and performance-related modeling choices. That means the repository covers both semantic correctness and authoring conventions.
10. The external ecosystem boundary is Tabular Editor and the Best Practice Analyzer wiki referenced in the README. Users install a packaged BPARules.json into a local Tabular Editor directory, so the repo’s output is effectively a configuration artifact consumed by a desktop modeling tool.
11. For an architecture diagram, the key flow is: individual rule JSON files in src/standard/ -> build scripts combine them -> release artifacts at the repo root -> Tabular Editor loads them -> BPA evaluates tabular model objects using Dynamic LINQ -> results are shown to the model author.
12. In short, this repository is a rules-engine content pack with no service layer, database, or UI of its own; its architecture is centered on rule definition, packaging, and distribution to a single downstream consumer.
Main entry points: standard Standard rules · README.md Rule schema · combine-rules.ps1 Combine rules · DAX Expressions DAX Expressions
Components 18
Source rules
Per-rule JSON definitions maintained as the source of truth.
- Standard rules · Main maintained source tree for individual rule definitions.
src/standard - DAX Expressions · Rules targeting DAX formula quality and authoring patterns.
src/standard/DAX Expressions - Formatting · Rules for formatting and expression style consistency.
src/standard/Formatting - Metadata · Rules focused on model metadata and semantic properties.
src/standard/Metadata - Model Layout · Rules for visibility, descriptions, and presentation of model objects.
src/standard/Model Layout - Naming Conventions · Rules enforcing consistent object and relationship naming.
src/standard/Naming Conventions - Performance · Rules identifying modeling choices with performance impact.
src/standard/Performance - Rule schema · Shared rule shape: ID, Name, Category, Description, Severity, Scope, Expression, optional FixExpression and Remarks.
README.md
Build & packaging
Scripts that split and combine rule fragments into distributable bundles.
- Combine rules · Build step that assembles per-rule JSON files into release bundles.
build/combine-rules.ps1 - Split rules · Build step that decomposes combined rulesets into individual files.
build/split-rules.ps1
Release bundles
Packaged JSON artifacts published for Tabular Editor users.
- Standard pack · Primary curated baseline ruleset for release.
BPARules-standard.json - Standard lax · Alternative standard pack with relaxed checks.
BPARules-standard-lax.json - Contrib pack · Community-oriented packaged ruleset.
BPARules-contrib.json - PowerBI pack · Packaged ruleset tailored to Power BI-oriented modeling.
BPARules-PowerBI.json
Downstream consumer
External tool that loads and evaluates the packaged rule sets.
- Tabular Editor · External modeling tool that loads the packaged BPA rule JSON.
- BPA engine · Best Practice Analyzer evaluates rules against tabular model objects.
- Dynamic LINQ · Execution language used in rule Expression fields.
- Tabular model · Model metadata and DAX expressions inspected by the rules.
Connections 25
- Standard rules → DAX Expressions: contains · Source tree is organized into analyzer categories.
- Standard rules → Formatting: contains · Source tree is organized into analyzer categories.
- Standard rules → Metadata: contains · Source tree is organized into analyzer categories.
- Standard rules → Model Layout: contains · Source tree is organized into analyzer categories.
- Standard rules → Naming Conventions: contains · Source tree is organized into analyzer categories.
- Standard rules → Performance: contains · Source tree is organized into analyzer categories.
- DAX Expressions → Rule schema: uses · Each rule file follows the shared JSON rule contract.
- Formatting → Rule schema: uses · Each rule file follows the shared JSON rule contract.
- Metadata → Rule schema: uses · Each rule file follows the shared JSON rule contract.
- Model Layout → Rule schema: uses · Each rule file follows the shared JSON rule contract.
- Naming Conventions → Rule schema: uses · Each rule file follows the shared JSON rule contract.
- Performance → Rule schema: uses · Each rule file follows the shared JSON rule contract.
- Split rules → Standard rules: extracts · Splits combined rules into per-rule source files.
- Combine rules → Standard pack: assembles · Combines source rules into the standard release bundle.
- Combine rules → Standard lax: assembles · Combines curated inputs into the relaxed release bundle.
- Combine rules → Contrib pack: assembles · Combines curated inputs into the contributor bundle.
- Combine rules → PowerBI pack: assembles · Combines curated inputs into the Power BI bundle.
- Standard pack → Tabular Editor: loaded by · Packaged bundle is consumed by the desktop tool.
- Standard lax → Tabular Editor: loaded by · Packaged bundle is consumed by the desktop tool.
- Contrib pack → Tabular Editor: loaded by · Packaged bundle is consumed by the desktop tool.
- PowerBI pack → Tabular Editor: loaded by · Packaged bundle is consumed by the desktop tool.
- Tabular Editor → BPA engine: hosts · The tool provides the BPA execution environment.
- BPA engine → Dynamic LINQ: evaluates · Rule expressions are executed as Dynamic LINQ.
- Dynamic LINQ → Tabular model: queries · Expressions inspect tabular model metadata and DAX objects.
- BPA engine → Tabular model: analyzes · Rules are applied to the model being authored.