Custom rules

pbiplint's own rules are the same for everyone. Most teams also have rules of their own: measures in a folder, visible names in plain words, Power Query that reads only the approved schemas. Custom rules let your team check those too, from the rule files it already keeps in Tabular Editor's Best Practice Analyzer format (BPARules.json), with nothing else installed. pbiplint runs them beside its own rules, on the semantic model and the Power Query code it holds, wherever pbiplint runs: on this site, on the command line, in pbiplint mcp, and in your GitHub Actions and Azure Pipelines.

On pbiplint.com, custom rules run now. In a copy your firm hosts, on the command line, and in the pipelines, they run from pbiplint 0.4.0; pbiplint --version says which you have, and a self-hosted copy names its version in each page's footer. A team that has never written a rule can have an AI assistant write one, with the skill and the reference pbiplint ships (below).

A rule file holds rules for the semantic model and its Power Query. Rules for the report, in fab-inspector's format, come in a later release.

Set up customRules

Put the rule file in the project's repository and name it in customRules in pbiplint.config.json. The config is the one place pbiplint reads it from, so the site, the command line, and the pipelines all run the same rules; there is no command-line option for it.

pbiplint.config.json
{
  "$schema": "https://pbiplint.com/schema/pbiplint.config.schema.json",
  "customRules": ["rules/team.json"],
  "rules": {
    "TEAM_MEASURE_DESCRIPTIONS": "error"
  }
}

A folder laid out like this works everywhere pbiplint runs, the site included:

Sales/
  pbiplint.config.json
  rules/
    team.json
  Sales.pbip
  Sales.SemanticModel/
  Sales.Report/

The rule file

A rule file is a JSON array of rules, or an object whose rules key holds that array; Tabular Editor reads both, and so does pbiplint. Comments (// and /* */), a byte order mark, and keys in any case are read too, as Tabular Editor reads them. Here is a file with one rule:

[
  {
    "ID": "TEAM_MEASURE_DESCRIPTIONS",
    "Name": "Visible measures have a description",
    "Category": "Documentation",
    "Description": "Flags a visible measure with no description.\n\nThe description is what a report author sees when they hover over the measure in the field list, and it is the only place that says what the number means.\n\nWrite one or two sentences on what the measure calculates and when to use it. If the measure is a helper no report should use, hide it instead.",
    "Severity": 2,
    "Scope": "Measure",
    "Expression": "IsVisible and string.IsNullOrWhiteSpace(Description)"
  }
]

pbiplint reads at most 2,000 rules from one file, and an Expression of at most 20,000 characters; a rule past either limit is reported as not read. The reference lists every property, function, and limit.

A rule with one of pbiplint's ids

Most team files start from Microsoft's ruleset, so they carry rules with the same ids as pbiplint's own, which pbiplint already runs. pbiplint tells the copies apart by comparing each one with every version of that rule published when this release was built: Microsoft's BPARules.json (opens in a new tab) in every language, and Tabular Editor's own rule files. A copy is unchanged when its scope is the same and its expression is the same, whitespace aside, as any of those versions.

A file that holds a rule with one of pbiplint's ids gets one notice, which says how many of its rules pbiplint runs as its own, which ids your team's rules replace, and how many run as the team's. Two files with the same custom id run an identical rule once; when the two rules differ, the first in customRules runs, and a notice names the other. A custom rule can never take the id PARSE_ISSUE or RULE_COULD_NOT_FINISH: such a rule cannot run, so neither of those safety nets can be replaced.

Tabular Editor's ignore annotation

Tabular Editor keeps the rules someone has dismissed in an annotation, BestPracticeAnalyzer_IgnoreRules, which Power BI Desktop keeps in the TMDL files. pbiplint honors it beside its own pbiplint.ignore, for every rule's findings on the model's objects, its own rules and your team's:

	column 'Product ID'
		dataType: int64
		annotation BestPracticeAnalyzer_IgnoreRules = {"RuleIDs":["HIDE_FOREIGN_KEYS"]}

This changes results for a project that carries the annotation, whether or not it uses custom rules: the findings its authors dismissed in Tabular Editor stop appearing. On pbiplint.com it does so now; on the command line and in a self-hosted copy, from 0.4.0.

When a rule cannot run

A rule that cannot run is never skipped without a word. It is one RULE_COULD_NOT_FINISH finding, an error on the model, whose detail names the rule, its file, and the reason, as in TEAM_VISIBLE could not finish on the model: rules/team.json: Measure has no property `Visible`; `IsHidden` is the nearest. The reason names the cause from the rule's own text, never a name or a value from your model, so it can be shared to get the rule fixed.

A rule cannot run when pbiplint cannot read it: it has no ID, no Scope, a scope pbiplint does not know, or a report scope, or no Expression. A rule that reads can still fail to run: when its expression does not parse; when it names a property, function, or regular expression construct pbiplint does not run; when it needs statistics from a live model; when it reaches a limit; or when it fails on an object, such as passing an empty value to RegEx.IsMatch. A failure on one object stops the rule for the whole project, as it does in Tabular Editor. The other rules in the file still run. For a rule with one of pbiplint's ids, the two kinds differ: a copy pbiplint cannot read runs beside pbiplint's rule, and one that reads but cannot run takes its place, as above says.

The finding fails a gated run, as any error does, so a clean result means every rule ran. The cause is in the rule file, so the fix is there: the reason says what to change, and an assistant can read it and fix the rule (below). Until then, turning the rule's id off in your config, as in "TEAM_VISIBLE": "off", removes both the rule and the finding.

A property that the project's files leave unset on some objects is different. Power BI Desktop saves most calculated columns with no data type, which Tabular Editor works out from the column's DAX; a rule that reads DataType leaves those columns out rather than guess, and one notice per rule says how many it left out. pbiplint's own rules do the same.

In the output

On the command line, all of this comes with pbiplint 0.4.0. A custom finding is always labelled as your team's rule, with its file, so it never passes for one of pbiplint's.

On this site

Drop or choose the folder that holds both the project and its rule files. The page reads pbiplint.config.json, then opens the rule files its customRules names, from inside that folder only, and nothing else in it. An entry that leads outside the folder, names a file that is not in it, or points into a folder pbiplint never opens, such as .git or node_modules, refuses the drop with a message saying why, and nothing is linted. Each finding of your team's rule is labelled "Your team's rule", with its file and its description.

The rule files run in your browser tab, like the rest of the project. The code that runs them is a file of the site's own, which the page fetches from the site once it has loaded and is idle, before you drop anything; no request follows a drop, and once the page has loaded, custom rules work with the network off. Nothing is sent anywhere and nothing is stored, so a second visit needs the folder again. The pbiplint Privacy Promise holds word for word, and its checks show it.

In your pipelines

The pbiplint Action in GitHub Actions and the pbiplint task in Azure Pipelines run the command line, which reads the project's pbiplint.config.json and the rule files it names, so custom rules need no new input: commit the rule files beside the config. They run once the step runs pbiplint 0.4.0 or later, the version the Action's pbiplint-version input or the task's pbiplintVersion input names. A rule that cannot run fails the check, as any error does. Pipelines lists what each step reads and sends.

Write a rule with an AI assistant

The format is technical, so pbiplint gives an AI assistant what it needs to write a rule and check it. On the command line, all three come with pbiplint 0.4.0:

Severity, and any change to a rule your team already has, stay your team's call. An assistant should never turn a rule off, or change the model, to make a new rule pass.

Worked examples

Four rules a team might write, from the skill. Each is one rule, as it would sit in a rule file's array, and each flags exactly the objects named on the fixture written for them (opens in a new tab) in pbiplint's repository. The first three keep the names teams already use for these conventions, which is why they have no team prefix.

Visible names in plain words

NO_CAMELCASE_COLUMNS_HIERARCHIES catches a visible column or hierarchy named in camelCase, such as customerName, which should read Customer Name. It flags the visible column customerName and the hierarchy orderCalendar, and leaves the hidden column orderKey, the code SKU, and Order Date.

{
  "ID": "NO_CAMELCASE_COLUMNS_HIERARCHIES",
  "Name": "Visible columns and hierarchies are not named in camelCase",
  "Category": "Naming",
  "Description": "Flags a visible column or hierarchy whose name starts with a lower-case letter and runs into an upper-case one with no space between, as customerName or orderCalendar do. Hidden objects are left alone, since report readers never see their names.\n\nThe names in the field list are the names on every visual. Words with spaces, such as Customer Name, read as plain language to the people using the report, while camelCase reads as a database column carried through unchanged.\n\nRename the object in words with spaces, such as Customer Name for customerName, and check the report's visuals and any DAX that refers to it. If the name is a code the business uses as written, hide the object or ask the team whether the rule should allow it.",
  "Severity": 2,
  "Scope": "DataColumn, CalculatedColumn, CalculatedTableColumn, Hierarchy",
  "Expression": "IsVisible and RegEx.IsMatch(Name, \"^[a-z][a-z0-9]*[A-Z]\")"
}

The pattern is anchored at the start, so a name that begins with a capital never matches.

Measures in display folders

LAYOUT_MEASURES_DF catches a measure a report reader can see that sits in no display folder. It flags Order Count, and leaves Total Sales, which is in a folder, and the hidden Sales Check.

{
  "ID": "LAYOUT_MEASURES_DF",
  "Name": "Visible measures sit in a display folder",
  "Category": "Layout",
  "Description": "Flags a visible measure with no display folder. Hidden measures are left alone, since they do not appear in the field list.\n\nFolders keep the field list short enough to scan as a model grows, and they put related measures, such as totals or ratios, where a report author expects to find them.\n\nSet the measure's display folder to the one its neighbours use, or start a new folder when none fits. If the measure is a helper no report should use, hide it instead.",
  "Severity": 1,
  "Scope": "Measure",
  "Expression": "IsVisible and string.IsNullOrWhiteSpace(DisplayFolder)"
}

Columns and hierarchies in display folders

LAYOUT_COLUMNS_HIERARCHIES_DF is the same convention for columns and hierarchies. It flags the column Test Value and the hierarchy orderCalendar, and leaves columns in folders, hidden columns, and Order Calendar, which is in one.

{
  "ID": "LAYOUT_COLUMNS_HIERARCHIES_DF",
  "Name": "Visible columns and hierarchies sit in a display folder",
  "Category": "Layout",
  "Description": "Flags a visible column or hierarchy with no display folder. Hidden columns, such as keys, are left alone.\n\nA table's columns and hierarchies are easier to find when grouped by subject, such as Dates or Customer, and a report author can tell at a glance which fields belong together.\n\nSet the object's display folder to one its table already uses, or start a new one. If the column exists only for relationships or sorting, hide it instead.",
  "Severity": 1,
  "Scope": "DataColumn, CalculatedColumn, CalculatedTableColumn, Hierarchy",
  "Expression": "IsVisible and string.IsNullOrWhiteSpace(DisplayFolder)"
}

Snowflake from approved schemas only

TEAM_APPROVED_SNOWFLAKE_SCHEMAS reads Power Query as text: a query that reads Snowflake must name one of the team's approved schemas, SALES or FINANCE. It flags the partition Scratch, which reads SANDBOX, and leaves the Sales partition, the shared query on FINANCE, and a partition that reads a CSV file.

{
  "ID": "TEAM_APPROVED_SNOWFLAKE_SCHEMAS",
  "Name": "Snowflake queries read an approved schema",
  "Category": "Data sources",
  "Description": "Flags a partition or shared query whose Power Query reads Snowflake but names neither of the approved schemas, SALES and FINANCE. A query that does not read Snowflake is left alone.\n\nThe approved schemas hold reviewed, governed data. A report built on a sandbox or staging schema can change or vanish without notice, and its numbers will not match the team's other reports.\n\nPoint the query at the same data in SALES or FINANCE; if it is not there yet, ask the data team to publish it. If the schema should be approved, ask the team to add it to this rule.",
  "Severity": 3,
  "Scope": "Partition, NamedExpression",
  "Expression": "not string.IsNullOrEmpty(Expression) and Expression.Contains(\"Snowflake.Databases\") and not RegEx.IsMatch(Expression, \"Name\\s*=\\s*\"\"(SALES|FINANCE)\"\"\\s*,\\s*Kind\\s*=\\s*\"\"Schema\"\"\")"
}

The empty-expression test comes first, since a partition with no Power Query has no Expression to search, and passing an empty one to RegEx.IsMatch would stop the rule. Inside the expression a quote is doubled (""), which the JSON file holds as \"\", and a backslash in the pattern is only doubled for JSON: \\s in the file is \s in the pattern. The pattern looks for the navigation step Power BI Desktop writes, Name="SALES",Kind="Schema", so a database that happens to be called SALES does not count.

What pbiplint does not run, and why

Reference

Everything a Tabular Editor rule can use in the pbiplint this site runs, and what it cannot, generated from the tables pbiplint runs, so it cannot drift from them. pbiplint reference prints the same for the version you have installed. Names match without regard to case: properties, methods, scopes, keywords, and enum values. Anything not listed is not run, and a rule that uses it is one RULE_COULD_NOT_FINISH finding with the reason.

Rule fields

FieldUseWhat pbiplint does with it
IDReadRequired. Text, or a whole number read as its digits; it names the rule in every finding, so no two rules may share one.
NameReadA short title for the rule; the ID stands in when there is none.
CategoryReadGroups the rule in the output; Custom when there is none.
DescriptionReadWhat everyone who meets a finding reads: what the rule checks, why, and how to fix it.
SeverityReadA number, or digits in a string; see the severities below. 1 when there is none.
ScopeReadRequired. A comma-separated list of the scopes below; the rule runs on each object of each one.
ExpressionReadRequired. The condition, as text; an object it is true for is a finding.
IsDisabledReadRead, but the rule still runs, as Tabular Editor CLI runs it; turn a rule off in pbiplint.config.json instead.
FixExpressionIgnoredpbiplint reports findings and never changes the model, so a fix is not run.
CompatibilityLevelIgnoredpbiplint runs the rule whatever the model's compatibility level.

Severities

Severity writtenpbiplint reads it as
Below 0info
0info
1info
2warning
3error
4 or moreerror
None writteninfo

Scopes

A rule's Scope names one or more of these, separated by commas; the rule runs on each object of each object type listed.

ScopeObject types it runs on
ModelModel
TableTable
CalculatedTableCalculatedTable
ColumnDataColumn, CalculatedColumn, CalculatedTableColumn
DataColumnDataColumn
CalculatedColumnCalculatedColumn
CalculatedTableColumnCalculatedTableColumn
MeasureMeasure
HierarchyHierarchy
LevelLevel
PartitionPartition
RelationshipRelationship
PerspectivePerspective
CultureCulture
ModelRoleModelRole
ModelRoleMemberModelRoleMember
TablePermissionTablePermission
CalculationGroupCalculationGroupTable
CalculationItemCalculationItem
KPIKPI
NamedExpressionNamedExpression
ProviderDataSourceProviderDataSource
StructuredDataSourceStructuredDataSource
VariationVariation
CalendarCalendar
UserDefinedFunctionFunction

Properties by object type

A type marked ? may be empty (null). A type with no scope is reached from another object, as a partition's Table is.

Model

In scopes: Model.

PropertyType
NameString
DescriptionString
ObjectTypeObjectType
ObjectTypeNameString
ModelModel
TranslatedNamesIndexer<String>
TranslatedDescriptionsIndexer<String>
TablesCollection<Table | CalculatedTable | CalculationGroupTable>
RelationshipsCollection<Relationship>
RolesCollection<ModelRole>
PerspectivesCollection<Perspective>
CulturesCollection<Culture>
ExpressionsCollection<NamedExpression>
DataSourcesCollection<ProviderDataSource | StructuredDataSource>
FunctionsCollection<Function>
CalculationGroupsCollection<CalculationGroupTable>
AllColumnsCollection<DataColumn | CalculatedColumn | CalculatedTableColumn>
AllMeasuresCollection<Measure>
AllHierarchiesCollection<Hierarchy>
AllLevelsCollection<Level>
AllPartitionsCollection<Partition>
AllCalculationItemsCollection<CalculationItem>
CultureString
SourceQueryCultureString
CollationString
DefaultModeModeType
DefaultPowerBIDataSourceVersionPowerBIDataSourceVersion
DiscourageImplicitMeasuresBoolean
Table

In scopes: Table.

PropertyType
NameString
DescriptionString
ObjectTypeObjectType
ObjectTypeNameString
ModelModel
IsHiddenBoolean
IsVisibleBoolean
DataCategoryString
ColumnsCollection<DataColumn | CalculatedColumn | CalculatedTableColumn>
MeasuresCollection<Measure>
HierarchiesCollection<Hierarchy>
PartitionsCollection<Partition>
CalendarsCollection<Calendar>
UsedInRelationshipsCollection<Relationship>
RowLevelSecurityIndexer<String>
ObjectLevelSecurityIndexer<MetadataPermission>
InPerspectiveIndexer<Boolean>
TranslatedNamesIndexer<String>
TranslatedDescriptionsIndexer<String>
ReferencedByCollection<Object>
ReferencedBy.MeasuresCollection<Measure>
ReferencedBy.ColumnsCollection<DataColumn | CalculatedColumn | CalculatedTableColumn>
ReferencedBy.TablesCollection<Table | CalculatedTable | CalculationGroupTable>
ReferencedBy.AllMeasuresCollection<Measure>
ReferencedBy.AllColumnsCollection<DataColumn | CalculatedColumn | CalculatedTableColumn>
ReferencedBy.AllTablesCollection<Table | CalculatedTable | CalculationGroupTable>
ReferencedBy.RolesCollection<ModelRole>
DaxObjectNameString
DaxObjectFullNameString
DaxTableNameString
SourceExpressionString?
ShowAsVariationsOnlyBoolean
IsPrivateBoolean
LineageTagString
ExpressionString?
CalculatedTable

In scopes: CalculatedTable.

PropertyType
NameString
DescriptionString
ObjectTypeObjectType
ObjectTypeNameString
ModelModel
IsHiddenBoolean
IsVisibleBoolean
DataCategoryString
ColumnsCollection<DataColumn | CalculatedColumn | CalculatedTableColumn>
MeasuresCollection<Measure>
HierarchiesCollection<Hierarchy>
PartitionsCollection<Partition>
CalendarsCollection<Calendar>
UsedInRelationshipsCollection<Relationship>
RowLevelSecurityIndexer<String>
ObjectLevelSecurityIndexer<MetadataPermission>
InPerspectiveIndexer<Boolean>
TranslatedNamesIndexer<String>
TranslatedDescriptionsIndexer<String>
ReferencedByCollection<Object>
ReferencedBy.MeasuresCollection<Measure>
ReferencedBy.ColumnsCollection<DataColumn | CalculatedColumn | CalculatedTableColumn>
ReferencedBy.TablesCollection<Table | CalculatedTable | CalculationGroupTable>
ReferencedBy.AllMeasuresCollection<Measure>
ReferencedBy.AllColumnsCollection<DataColumn | CalculatedColumn | CalculatedTableColumn>
ReferencedBy.AllTablesCollection<Table | CalculatedTable | CalculationGroupTable>
ReferencedBy.RolesCollection<ModelRole>
DaxObjectNameString
DaxObjectFullNameString
DaxTableNameString
SourceExpressionString?
ShowAsVariationsOnlyBoolean
IsPrivateBoolean
LineageTagString
ExpressionString
DependsOnCollection<Dependency>
DependsOn.MeasuresCollection<Measure>
DependsOn.ColumnsCollection<DataColumn | CalculatedColumn | CalculatedTableColumn>
DependsOn.TablesCollection<Table | CalculatedTable | CalculationGroupTable>
CalculationGroupTable

In scopes: CalculationGroup.

PropertyType
NameString
DescriptionString
ObjectTypeObjectType
ObjectTypeNameString
ModelModel
IsHiddenBoolean
IsVisibleBoolean
DataCategoryString
ColumnsCollection<DataColumn | CalculatedColumn | CalculatedTableColumn>
MeasuresCollection<Measure>
HierarchiesCollection<Hierarchy>
PartitionsCollection<Partition>
CalendarsCollection<Calendar>
UsedInRelationshipsCollection<Relationship>
RowLevelSecurityIndexer<String>
ObjectLevelSecurityIndexer<MetadataPermission>
InPerspectiveIndexer<Boolean>
TranslatedNamesIndexer<String>
TranslatedDescriptionsIndexer<String>
ReferencedByCollection<Object>
ReferencedBy.MeasuresCollection<Measure>
ReferencedBy.ColumnsCollection<DataColumn | CalculatedColumn | CalculatedTableColumn>
ReferencedBy.TablesCollection<Table | CalculatedTable | CalculationGroupTable>
ReferencedBy.AllMeasuresCollection<Measure>
ReferencedBy.AllColumnsCollection<DataColumn | CalculatedColumn | CalculatedTableColumn>
ReferencedBy.AllTablesCollection<Table | CalculatedTable | CalculationGroupTable>
ReferencedBy.RolesCollection<ModelRole>
DaxObjectNameString
DaxObjectFullNameString
DaxTableNameString
SourceExpressionString?
ShowAsVariationsOnlyBoolean
IsPrivateBoolean
LineageTagString
ExpressionString?
CalculationItemsCollection<CalculationItem>
CalculationGroupCalculationGroup
CalculationGroupPrecedenceInt32
DataColumn

In scopes: Column, DataColumn.

PropertyType
NameString
DescriptionString
ObjectTypeObjectType
ObjectTypeNameString
ModelModel
IsHiddenBoolean
IsVisibleBoolean
TableTable | CalculatedTable | CalculationGroupTable
DataTypeDataType
TypeColumnType
DisplayFolderString
FormatStringString
DataCategoryString
SummarizeByAggregateFunction
IsKeyBoolean
IsAvailableInMDXBoolean
IsNullableBoolean
IsUniqueBoolean
SortByColumnDataColumn | CalculatedColumn | CalculatedTableColumn
UsedInSortByCollection<DataColumn | CalculatedColumn | CalculatedTableColumn>
UsedInHierarchiesCollection<Hierarchy>
UsedInLevelsCollection<Level>
UsedInRelationshipsCollection<Relationship>
UsedInVariationsCollection<Variation>
VariationsCollection<Variation>
AlternateOfAlternateOf
ObjectLevelSecurityIndexer<MetadataPermission>
InPerspectiveIndexer<Boolean>
TranslatedNamesIndexer<String>
TranslatedDescriptionsIndexer<String>
TranslatedDisplayFoldersIndexer<String>
ReferencedByCollection<Object>
ReferencedBy.MeasuresCollection<Measure>
ReferencedBy.ColumnsCollection<DataColumn | CalculatedColumn | CalculatedTableColumn>
ReferencedBy.TablesCollection<Table | CalculatedTable | CalculationGroupTable>
ReferencedBy.AllMeasuresCollection<Measure>
ReferencedBy.AllColumnsCollection<DataColumn | CalculatedColumn | CalculatedTableColumn>
ReferencedBy.AllTablesCollection<Table | CalculatedTable | CalculationGroupTable>
ReferencedBy.RolesCollection<ModelRole>
DaxObjectNameString
DaxObjectFullNameString
DaxTableNameString
LineageTagString
SourceColumnString
CalculatedColumn

In scopes: Column, CalculatedColumn.

PropertyType
NameString
DescriptionString
ObjectTypeObjectType
ObjectTypeNameString
ModelModel
IsHiddenBoolean
IsVisibleBoolean
TableTable | CalculatedTable | CalculationGroupTable
DataTypeDataType
TypeColumnType
DisplayFolderString
FormatStringString
DataCategoryString
SummarizeByAggregateFunction
IsKeyBoolean
IsAvailableInMDXBoolean
IsNullableBoolean
IsUniqueBoolean
SortByColumnDataColumn | CalculatedColumn | CalculatedTableColumn
UsedInSortByCollection<DataColumn | CalculatedColumn | CalculatedTableColumn>
UsedInHierarchiesCollection<Hierarchy>
UsedInLevelsCollection<Level>
UsedInRelationshipsCollection<Relationship>
UsedInVariationsCollection<Variation>
VariationsCollection<Variation>
AlternateOfAlternateOf
ObjectLevelSecurityIndexer<MetadataPermission>
InPerspectiveIndexer<Boolean>
TranslatedNamesIndexer<String>
TranslatedDescriptionsIndexer<String>
TranslatedDisplayFoldersIndexer<String>
ReferencedByCollection<Object>
ReferencedBy.MeasuresCollection<Measure>
ReferencedBy.ColumnsCollection<DataColumn | CalculatedColumn | CalculatedTableColumn>
ReferencedBy.TablesCollection<Table | CalculatedTable | CalculationGroupTable>
ReferencedBy.AllMeasuresCollection<Measure>
ReferencedBy.AllColumnsCollection<DataColumn | CalculatedColumn | CalculatedTableColumn>
ReferencedBy.AllTablesCollection<Table | CalculatedTable | CalculationGroupTable>
ReferencedBy.RolesCollection<ModelRole>
DaxObjectNameString
DaxObjectFullNameString
DaxTableNameString
LineageTagString
ExpressionString
DependsOnCollection<Dependency>
DependsOn.MeasuresCollection<Measure>
DependsOn.ColumnsCollection<DataColumn | CalculatedColumn | CalculatedTableColumn>
DependsOn.TablesCollection<Table | CalculatedTable | CalculationGroupTable>
CalculatedTableColumn

In scopes: Column, CalculatedTableColumn.

PropertyType
NameString
DescriptionString
ObjectTypeObjectType
ObjectTypeNameString
ModelModel
IsHiddenBoolean
IsVisibleBoolean
TableTable | CalculatedTable | CalculationGroupTable
DataTypeDataType
TypeColumnType
DisplayFolderString
FormatStringString
DataCategoryString
SummarizeByAggregateFunction
IsKeyBoolean
IsAvailableInMDXBoolean
IsNullableBoolean
IsUniqueBoolean
SortByColumnDataColumn | CalculatedColumn | CalculatedTableColumn
UsedInSortByCollection<DataColumn | CalculatedColumn | CalculatedTableColumn>
UsedInHierarchiesCollection<Hierarchy>
UsedInLevelsCollection<Level>
UsedInRelationshipsCollection<Relationship>
UsedInVariationsCollection<Variation>
VariationsCollection<Variation>
AlternateOfAlternateOf
ObjectLevelSecurityIndexer<MetadataPermission>
InPerspectiveIndexer<Boolean>
TranslatedNamesIndexer<String>
TranslatedDescriptionsIndexer<String>
TranslatedDisplayFoldersIndexer<String>
ReferencedByCollection<Object>
ReferencedBy.MeasuresCollection<Measure>
ReferencedBy.ColumnsCollection<DataColumn | CalculatedColumn | CalculatedTableColumn>
ReferencedBy.TablesCollection<Table | CalculatedTable | CalculationGroupTable>
ReferencedBy.AllMeasuresCollection<Measure>
ReferencedBy.AllColumnsCollection<DataColumn | CalculatedColumn | CalculatedTableColumn>
ReferencedBy.AllTablesCollection<Table | CalculatedTable | CalculationGroupTable>
ReferencedBy.RolesCollection<ModelRole>
DaxObjectNameString
DaxObjectFullNameString
DaxTableNameString
LineageTagString
SourceColumnString
Measure

In scopes: Measure.

PropertyType
NameString
DescriptionString
ObjectTypeObjectType
ObjectTypeNameString
ModelModel
IsHiddenBoolean
IsVisibleBoolean
TableTable | CalculatedTable | CalculationGroupTable
ExpressionString
FormatStringString
FormatStringExpressionString
DisplayFolderString
DataCategoryString
DataTypeDataType
KPIKPI
InPerspectiveIndexer<Boolean>
TranslatedNamesIndexer<String>
TranslatedDescriptionsIndexer<String>
TranslatedDisplayFoldersIndexer<String>
ReferencedByCollection<Object>
ReferencedBy.MeasuresCollection<Measure>
ReferencedBy.ColumnsCollection<DataColumn | CalculatedColumn | CalculatedTableColumn>
ReferencedBy.TablesCollection<Table | CalculatedTable | CalculationGroupTable>
ReferencedBy.AllMeasuresCollection<Measure>
ReferencedBy.AllColumnsCollection<DataColumn | CalculatedColumn | CalculatedTableColumn>
ReferencedBy.AllTablesCollection<Table | CalculatedTable | CalculationGroupTable>
ReferencedBy.RolesCollection<ModelRole>
DependsOnCollection<Dependency>
DependsOn.MeasuresCollection<Measure>
DependsOn.ColumnsCollection<DataColumn | CalculatedColumn | CalculatedTableColumn>
DependsOn.TablesCollection<Table | CalculatedTable | CalculationGroupTable>
DaxObjectNameString
DaxObjectFullNameString
DaxTableNameString
LineageTagString
KPI

In scopes: KPI.

PropertyType
NameString
DescriptionString
ObjectTypeObjectType
ObjectTypeNameString
ModelModel
MeasureMeasure
TargetExpressionString
StatusExpressionString
TrendExpressionString
TargetFormatStringString
TargetDescriptionString
StatusDescriptionString
TrendDescriptionString
StatusGraphicString
TrendGraphicString
DependsOnCollection<Dependency>
DependsOn.MeasuresCollection<Measure>
DependsOn.ColumnsCollection<DataColumn | CalculatedColumn | CalculatedTableColumn>
DependsOn.TablesCollection<Table | CalculatedTable | CalculationGroupTable>
Hierarchy

In scopes: Hierarchy.

PropertyType
NameString
DescriptionString
ObjectTypeObjectType
ObjectTypeNameString
ModelModel
IsHiddenBoolean
IsVisibleBoolean
TableTable | CalculatedTable | CalculationGroupTable
DisplayFolderString
LevelsCollection<Level>
InPerspectiveIndexer<Boolean>
TranslatedNamesIndexer<String>
TranslatedDescriptionsIndexer<String>
TranslatedDisplayFoldersIndexer<String>
LineageTagString
Level

In scopes: Level.

PropertyType
NameString
DescriptionString
ObjectTypeObjectType
ObjectTypeNameString
ModelModel
HierarchyHierarchy
TableTable | CalculatedTable | CalculationGroupTable
ColumnDataColumn | CalculatedColumn | CalculatedTableColumn
OrdinalInt32
TranslatedNamesIndexer<String>
TranslatedDescriptionsIndexer<String>
LineageTagString
Partition

In scopes: Partition.

PropertyType
NameString
DescriptionString
ObjectTypeObjectType
ObjectTypeNameString
ModelModel
TableTable | CalculatedTable | CalculationGroupTable
SourceTypePartitionSourceType
ModeModeType
ExpressionString?
QueryString?
DataSourceProviderDataSource | StructuredDataSource
Relationship

In scopes: Relationship.

PropertyType
NameString
ObjectTypeObjectType
ObjectTypeNameString
ModelModel
FromColumnDataColumn | CalculatedColumn | CalculatedTableColumn
ToColumnDataColumn | CalculatedColumn | CalculatedTableColumn
FromTableTable | CalculatedTable | CalculationGroupTable
ToTableTable | CalculatedTable | CalculationGroupTable
FromCardinalityRelationshipEndCardinality
ToCardinalityRelationshipEndCardinality
CrossFilteringBehaviorCrossFilteringBehavior
SecurityFilteringBehaviorSecurityFilteringBehavior
JoinOnDateBehaviorDateTimeRelationshipBehavior
RelyOnReferentialIntegrityBoolean
IsActiveBoolean
Perspective

In scopes: Perspective.

PropertyType
NameString
DescriptionString
ObjectTypeObjectType
ObjectTypeNameString
ModelModel
TranslatedNamesIndexer<String>
TranslatedDescriptionsIndexer<String>
Culture

In scopes: Culture.

PropertyType
NameString
ObjectTypeObjectType
ObjectTypeNameString
ModelModel
ModelRole

In scopes: ModelRole.

PropertyType
NameString
DescriptionString
ObjectTypeObjectType
ObjectTypeNameString
ModelModel
MembersCollection<ModelRoleMember>
TablePermissionsCollection<TablePermission>
ModelPermissionModelPermission
RowLevelSecurityIndexer<String>
ModelRoleMember

In scopes: ModelRoleMember.

PropertyType
NameString
MemberNameString
ObjectTypeObjectType
ObjectTypeNameString
ModelModel
RoleModelRole
TablePermission

In scopes: TablePermission.

PropertyType
NameString
DescriptionString
ObjectTypeObjectType
ObjectTypeNameString
ModelModel
TableTable | CalculatedTable | CalculationGroupTable
RoleModelRole
ExpressionString
FilterExpressionString
MetadataPermissionMetadataPermission
DependsOnCollection<Dependency>
DependsOn.MeasuresCollection<Measure>
DependsOn.ColumnsCollection<DataColumn | CalculatedColumn | CalculatedTableColumn>
DependsOn.TablesCollection<Table | CalculatedTable | CalculationGroupTable>
CalculationItem

In scopes: CalculationItem.

PropertyType
NameString
DescriptionString
ObjectTypeObjectType
ObjectTypeNameString
ModelModel
ExpressionString
FormatStringExpressionString
CalculationGroupCalculationGroupTable
TableCalculationGroupTable
OrdinalInt32
DependsOnCollection<Dependency>
DependsOn.MeasuresCollection<Measure>
DependsOn.ColumnsCollection<DataColumn | CalculatedColumn | CalculatedTableColumn>
DependsOn.TablesCollection<Table | CalculatedTable | CalculationGroupTable>
NamedExpression

In scopes: NamedExpression.

PropertyType
NameString
DescriptionString
ObjectTypeObjectType
ObjectTypeNameString
ModelModel
ExpressionString
ProviderDataSource

In scopes: ProviderDataSource.

PropertyType
NameString
DescriptionString
ObjectTypeObjectType
ObjectTypeNameString
ModelModel
TypeDataSourceType
ConnectionStringString
UsedByPartitionsCollection<Partition>
StructuredDataSource

In scopes: StructuredDataSource.

PropertyType
NameString
DescriptionString
ObjectTypeObjectType
ObjectTypeNameString
ModelModel
TypeDataSourceType
UsedByPartitionsCollection<Partition>
Variation

In scopes: Variation.

PropertyType
NameString
DescriptionString
ObjectTypeObjectType
ObjectTypeNameString
ModelModel
ColumnDataColumn | CalculatedColumn | CalculatedTableColumn
IsDefaultBoolean
RelationshipRelationship
DefaultHierarchyHierarchy
DefaultColumnDataColumn | CalculatedColumn | CalculatedTableColumn
Calendar

In scopes: Calendar.

PropertyType
NameString
DescriptionString
ObjectTypeObjectType
ObjectTypeNameString
ModelModel
TableTable | CalculatedTable | CalculationGroupTable
DaxObjectNameString
DaxObjectFullNameString
Function

In scopes: UserDefinedFunction.

PropertyType
NameString
DescriptionString
ObjectTypeObjectType
ObjectTypeNameString
ModelModel
ExpressionString
DependsOnCollection<Dependency>
DependsOn.MeasuresCollection<Measure>
DependsOn.ColumnsCollection<DataColumn | CalculatedColumn | CalculatedTableColumn>
DependsOn.TablesCollection<Table | CalculatedTable | CalculationGroupTable>
ReferencedByCollection<Object>
ReferencedBy.MeasuresCollection<Measure>
ReferencedBy.ColumnsCollection<DataColumn | CalculatedColumn | CalculatedTableColumn>
ReferencedBy.TablesCollection<Table | CalculatedTable | CalculationGroupTable>
ReferencedBy.AllMeasuresCollection<Measure>
ReferencedBy.AllColumnsCollection<DataColumn | CalculatedColumn | CalculatedTableColumn>
ReferencedBy.AllTablesCollection<Table | CalculatedTable | CalculationGroupTable>
ReferencedBy.RolesCollection<ModelRole>
CalculationGroup

In no scope: reached from another object.

PropertyType
DescriptionString
ObjectTypeObjectType
ObjectTypeNameString
ModelModel
PrecedenceInt32
CalculationItemsCollection<CalculationItem>
TableCalculationGroupTable
AlternateOf

In no scope: reached from another object.

PropertyType
SummarizationSummarizationType
BaseTableTable | CalculatedTable | CalculationGroupTable
BaseColumnDataColumn | CalculatedColumn | CalculatedTableColumn
ColumnDataColumn | CalculatedColumn | CalculatedTableColumn
Dependency

In no scope: reached from another object.

PropertyType
KeyObject
ValueCollection<ObjectReference>
ObjectReference

In no scope: reached from another object.

PropertyType
FullyQualifiedBoolean

Operators, loosest first

WrittenPrecedenceWhat it does
? :1test ? then : otherwise: the second value when the test is true, else the third.
??2The left value, or the right one when the left is null.
|| or3True when either side is true; the right side runs only when the left is not true.
&& and4True when both sides are true; the right side runs only when the left is not false.
== =5Equal: strings with case, enum values by name, objects by identity.
!= <>5Not equal, the opposite of ==.
<5Less than: numbers, characters, enum values in order, strings in culture order.
>5Greater than, ordered as < orders.
<=5Less than or equal, ordered as < orders.
>=5Greater than or equal, ordered as < orders.
+6Adds two numbers, or joins two strings (null counts as empty).
-6Subtracts one number from another.
&6Joins two values as text, turning each into a string first.
*7Multiplies two numbers.
/7Divides; two whole numbers give a whole number, rounded toward zero.
% mod7The remainder after dividing, with the sign of the left side.
! not8True when the value is false, and false when it is true.
-8The number with its sign changed.
.9Reads a property or calls a method of the value before it, as in Table.Name.
[ ]9Reads one element by position, or an indexer by name, as in TranslatedNames["fr-FR"].
( )9Calls a method with its arguments, or groups part of an expression to run first.
,9Separates the arguments of a call or an index.
$9The object the rule runs on, the same as it.

Keywords

KeywordWhat it means
trueThe Boolean value true.
falseThe Boolean value false.
nullNo value, as a property the model leaves empty gives.
itThe object the rule runs on; inside a condition such as Any(...), the element being tested.
outerItInside a condition, the value it was just outside it, one level up.
currentThe object the rule runs on, at any depth of conditions.
iifiif(test, then, otherwise): the same as test ? then : otherwise.
notThe word form of !.
andThe word form of &&.
orThe word form of ||.
modThe word form of %.

Literals

WrittenTypeWhat it means
"Sales"StringText between " quotes.
"say ""hi"""StringA quote inside a string is doubled, so this one is say "hi". There are no backslash escapes: a backslash is itself, so "\d" is a backslash and a d.
'a'CharExactly one character between ' quotes; a ' inside one is doubled, as ''''.
42Int32A whole number is Int32, or UInt32, Int64 or UInt64, the first it fits.
1.5DoubleA number with a decimal point is Double.
2e3DoubleA number with an exponent is Double.
10LInt64The suffix L (or l) makes the number Int64; it needs a whole number.
10UUInt32The suffix U (or u) makes the number UInt32; it needs a whole number.
10ULUInt64The suffix UL (or ul) makes the number UInt64; it needs a whole number.
10LUUInt64The suffix LU (or lu) makes the number UInt64; it needs a whole number.
1.5FSingleThe suffix F (or f) makes the number Single.
1.5DDoubleThe suffix D (or d) makes the number Double.
1.5MDecimalThe suffix M (or m) makes the number Decimal.
@itname@ before a name makes it a property even when it is a keyword or a type name, so @it is a property named it.

Empty values

A property marked ? can be empty (null). Reading a property of an empty value, calling a method on it, or indexing it gives no finding for that object, and the rule goes on to the next object; passing an empty value to a function, as in RegEx.IsMatch(Expression, ...), stops the rule. Otherwise an empty value follows .NET's rules: == null tests for one, + joins it to text as empty text, arithmetic on it gives an empty value, and a condition that comes out empty gives no finding.

Methods by value type

String
Method or propertyWhat it gives
Length: Int32How many characters the string has.
Contains(value: String): BooleanWhether the string holds the value, matching case exactly.
Contains(value: Char): BooleanWhether the string holds the character.
Contains(value: String, comparison: StringComparison): BooleanWhether the string holds the value, ignoring case if the comparison says so.
StartsWith(value: String): BooleanWhether the string begins with the value, matching case exactly.
StartsWith(value: Char): BooleanWhether the string begins with the character.
StartsWith(value: String, comparison: StringComparison): BooleanWhether the string begins with the value, ignoring case if the comparison says so.
EndsWith(value: String): BooleanWhether the string ends with the value, matching case exactly.
EndsWith(value: Char): BooleanWhether the string ends with the character.
EndsWith(value: String, comparison: StringComparison): BooleanWhether the string ends with the value, ignoring case if the comparison says so.
IndexOf(value: String): Int32Where the value first appears, counting from 0, or -1; case must match.
IndexOf(value: Char): Int32Where the character first appears, counting from 0, or -1.
IndexOf(value: String, comparison: StringComparison): Int32Where the value first appears, or -1, ignoring case if the comparison says so.
IndexOf(value: String, startIndex: Int32): Int32Where the value first appears at or after the start index, or -1.
IndexOf(value: Char, startIndex: Int32): Int32Where the character first appears at or after the start index, or -1.
LastIndexOf(value: String): Int32Where the value last appears, counting from 0, or -1; case must match.
LastIndexOf(value: Char): Int32Where the character last appears, counting from 0, or -1.
LastIndexOf(value: String, comparison: StringComparison): Int32Where the value last appears, or -1, ignoring case if the comparison says so.
Replace(oldValue: String, newValue: String): StringThe string with every occurrence of one value replaced by another, matching case exactly.
Replace(oldChar: Char, newChar: Char): StringThe string with every occurrence of one character replaced by another.
Substring(startIndex: Int32): StringThe string from the start index to its end; fails the rule past the end.
Substring(startIndex: Int32, length: Int32): StringThat many characters from the start index; fails the rule past the end.
ToUpper(): StringThe string in upper case, one character at a time.
ToLower(): StringThe string in lower case, one character at a time.
ToUpperInvariant(): StringThe string in upper case, the same in every culture.
ToLowerInvariant(): StringThe string in lower case, the same in every culture.
Trim(): StringThe string without white space at either end.
TrimStart(): StringThe string without white space at its start.
TrimEnd(): StringThe string without white space at its end.
ToCharArray(): Collection<Char>The string's characters, for a condition on each one.
Split(separator: Char): Collection<String>The parts of the string between each separator character.
Split(separator: String): Collection<String>The parts of the string between each separator.
Equals(value: String): BooleanWhether the two strings are the same, matching case exactly.
Equals(value: String, comparison: StringComparison): BooleanWhether the two strings are the same, ignoring case if the comparison says so.
CompareTo(value: String): Int32-1, 0 or 1 as the string sorts before, with, or after the value, in culture order.
ToString(): StringThe string itself.
Collection
Method or propertyWhat it gives
Count: Int32How many elements the collection has.
Any(): BooleanWhether the collection has any element.
Any(condition: Predicate): BooleanWhether the condition holds for at least one element.
All(condition: Predicate): BooleanWhether the condition holds for every element (true for an empty collection).
Count(): Int32How many elements there are.
Count(condition: Predicate): Int32How many elements the condition holds for.
LongCount(): Int64How many elements there are.
LongCount(condition: Predicate): Int64How many elements the condition holds for.
Where(condition: Predicate): Collection<T>The elements the condition holds for.
Select(selector: Selector): Collection<Selector>The selector's value for each element.
First(): TThe first element; fails the rule on an empty collection.
First(condition: Predicate): TThe first element the condition holds for; fails the rule if there is none.
FirstOrDefault(): T?The first element, or null for an empty collection.
FirstOrDefault(condition: Predicate): T?The first element the condition holds for, or null.
Last(): TThe last element; fails the rule on an empty collection.
Last(condition: Predicate): TThe last element the condition holds for; fails the rule if there is none.
LastOrDefault(): T?The last element, or null for an empty collection.
LastOrDefault(condition: Predicate): T?The last element the condition holds for, or null.
Sum(): NumberThe numbers added up (0 for an empty collection).
Sum(selector: Selector): NumberThe selector's numbers added up (0 for an empty collection).
Max(): TThe largest element; fails the rule on an empty collection.
Max(selector: Selector): SelectorThe selector's largest value; fails the rule on an empty collection.
Min(): TThe smallest element; fails the rule on an empty collection.
Min(selector: Selector): SelectorThe selector's smallest value; fails the rule on an empty collection.
Average(): DoubleThe mean of the numbers; fails the rule on an empty collection.
Average(selector: Selector): DoubleThe mean of the selector's numbers; fails the rule on an empty collection.
Contains(value: T): BooleanWhether the collection holds the value.
Distinct(): Collection<T>The elements with repeats removed, first ones kept.
OrderBy(selector: Selector): Collection<T>The elements sorted by the selector's value, smallest first.
OrderByDescending(selector: Selector): Collection<T>The elements sorted by the selector's value, largest first.
Skip(count: Int32): Collection<T>The elements after the first few.
Take(count: Int32): Collection<T>The first few elements.
ToList(): Collection<T>The same elements, as a list.
ToArray(): Collection<T>The same elements, as an array.
Char
Method or propertyWhat it gives
ToString(): StringThe character as text, as .NET prints it.
Equals(value: Object): BooleanWhether the character equals the value.
CompareTo(value: Char): Int32-1, 0 or 1 as the character's code is below, equal to, or above the other's.
Number
Method or propertyWhat it gives
ToString(): StringThe number as text, as .NET prints it.
Equals(value: Object): BooleanWhether the number equals the value.
CompareTo(value: Number): Int32-1, 0 or 1 as the number is below, equal to, or above the value.
Boolean
Method or propertyWhat it gives
ToString(): StringThe value as text, as .NET prints it.
Equals(value: Object): BooleanWhether the value equals the value.
Enum
Method or propertyWhat it gives
ToString(): StringThe enum value as text, as .NET prints it.
Equals(value: Object): BooleanWhether the enum value equals the value.
Object
Method or propertyWhat it gives
GetAnnotation(name: String): String?The object's annotation of that name, or null when it has none.
HasAnnotation(name: String): BooleanWhether the object has an annotation of that name.
Tokenize(): Collection<DaxToken>The tokens of the object's DAX, comments and white space included, each with Type, Text and Next.

Static functions and values

Function or valueWhat it gives
String.IsNullOrEmpty(value: String): BooleanWhether the string is null or has no characters.
String.IsNullOrWhiteSpace(value: String): BooleanWhether the string is null, empty, or only white space; names match without regard to case, so IsNullOrWhitespace is the same.
String.Concat(a: String, b: String): StringThe strings joined end to end; null counts as empty.
String.Concat(a: String, b: String, c: String): StringThe strings joined end to end; null counts as empty.
String.Join(separator: String, values: Collection<String>): StringThe strings of a collection joined with the separator between each.
String.Compare(a: String, b: String): Int32-1, 0 or 1 as the first string sorts before, with, or after the second, in culture order.
String.Equals(a: String, b: String): BooleanWhether the two strings are the same, matching case exactly.
Char.IsWhiteSpace(c: Char): BooleanWhether the character is white space, as .NET defines it.
Char.IsLetter(c: Char): BooleanWhether the character is a letter, in any script.
Char.IsDigit(c: Char): BooleanWhether the character is a decimal digit, in any script.
Char.IsLetterOrDigit(c: Char): BooleanWhether the character is a letter or a decimal digit.
Char.IsUpper(c: Char): BooleanWhether the character is an upper-case letter.
Char.IsLower(c: Char): BooleanWhether the character is a lower-case letter.
Char.IsControl(c: Char): BooleanWhether the character is a control character, such as a tab or a line break.
Char.IsPunctuation(c: Char): BooleanWhether the character is punctuation.
Char.IsNumber(c: Char): BooleanWhether the character is a digit or other number character.
Char.IsSymbol(c: Char): BooleanWhether the character is a symbol, such as a currency sign.
Char.IsSeparator(c: Char): BooleanWhether the character is a space or other separator.
Char.ToUpper(c: Char): CharThe character in upper case.
Char.ToLower(c: Char): CharThe character in lower case.
Convert.ToInt32(value: Object): Int32A whole number from a string, number, character or true/false; null gives 0; anything else fails the rule.
Convert.ToInt64(value: Object): Int64A whole number from a string, number, character or true/false; null gives 0; anything else fails the rule.
Convert.ToDecimal(value: Object): DecimalA decimal number from a string or number; null gives 0; anything else fails the rule.
Convert.ToDouble(value: Object): DoubleA double from a string or number; null gives 0; anything else fails the rule.
Convert.ToString(value: Object): StringThe value as text, as .NET prints it; null gives an empty string.
Convert.ToBoolean(value: Object): BooleanTrue or false from the text True or False (any case) or a number (0 is false); anything else fails the rule.
Convert.ToChar(value: Object): CharThe character with a code (Convert.ToChar(10) is a line feed), or the one character of a string.
Math.Max(a: Number, b: Number): NumberThe larger of two numbers; a double if either is.
Math.Min(a: Number, b: Number): NumberThe smaller of two numbers; a double if either is.
Math.Abs(value: Number): NumberThe number without its sign.
Math.Round(value: Number): DoubleThe nearest whole number, halves to the even one, as .NET rounds.
Math.Round(value: Number, digits: Int32): DoubleThe number rounded to that many decimal places, halves to the even one.
Math.Floor(value: Number): DoubleThe largest whole number not above the value.
Math.Ceiling(value: Number): DoubleThe smallest whole number not below the value.
Regex.IsMatch(input: String, pattern: String): BooleanWhether the .NET regular expression matches anywhere in the input; also spelled RegEx. Fails the rule on a null input or a pattern that does not compile.
Regex.IsMatch(input: String, pattern: String, options: RegexOptions): BooleanThe same, with RegexOptions.IgnoreCase or RegexOptions.None; any other option stops the rule.
String.Empty: StringThe empty string.

Conversions

TypeWritten
CharChar(...)
SByteSByte(...)
ByteByte(...)
Int16Int16(...) or short(...)
UInt16UInt16(...) or ushort(...)
Int32Int32(...) or int(...)
UInt32UInt32(...) or uint(...)
Int64Int64(...) or long(...)
UInt64UInt64(...) or ulong(...)
SingleSingle(...) or float(...)
DoubleDouble(...)
DecimalDecimal(...)

Enums

EnumValuesWhat it is
DataTypeAutomatic, String, Int64, Double, DateTime, Decimal, Boolean, Binary, Unknown, VariantThe values of the model's DataType property, by name.
AggregateFunctionDefault, None, Sum, Min, Max, Count, Average, DistinctCountThe values of the model's AggregateFunction property, by name.
CrossFilteringBehaviorOneDirection, BothDirections, AutomaticThe values of the model's CrossFilteringBehavior property, by name.
RelationshipEndCardinalityNone, One, ManyThe values of the model's RelationshipEndCardinality property, by name.
SecurityFilteringBehaviorOneDirection, BothDirections, NoneThe values of the model's SecurityFilteringBehavior property, by name.
DateTimeRelationshipBehaviorDateAndTime, DatePartOnlyThe values of the model's DateTimeRelationshipBehavior property, by name.
PartitionSourceTypeQuery, Calculated, None, M, Entity, PolicyRange, CalculationGroup, Inferred, ParquetThe values of the model's PartitionSourceType property, by name.
ModeTypeImport, DirectQuery, Default, Push, Dual, DirectLakeThe values of the model's ModeType property, by name.
ColumnTypeData, Calculated, RowNumber, CalculatedTableColumnThe values of the model's ColumnType property, by name.
DataSourceTypeProvider, StructuredThe values of the model's DataSourceType property, by name.
MetadataPermissionDefault, None, ReadThe values of the model's MetadataPermission property, by name.
ModelPermissionNone, Read, ReadRefresh, Refresh, AdministratorThe values of the model's ModelPermission property, by name.
PowerBIDataSourceVersionPowerBI_V1, PowerBI_V2, PowerBI_V3The values of the model's PowerBIDataSourceVersion property, by name.
SummarizationTypeGroupBy, Sum, Count, Min, MaxThe values of the model's SummarizationType property, by name.
ObjectTypeModel, DataSource, Table, CalculationGroupTable, Column, Partition, Relationship, Measure, Hierarchy, Level, KPI, Culture, Perspective, Role, RoleMember, TablePermission, Variation, Expression, CalculationGroup, CalculationItem, Calendar, FunctionThe values of the model's ObjectType property, by name.
StringComparisonCurrentCulture, CurrentCultureIgnoreCase, InvariantCulture, InvariantCultureIgnoreCase, Ordinal, OrdinalIgnoreCaseHow IndexOf, Contains, StartsWith, EndsWith and Equals compare: ordinal, or ignoring case.
RegexOptionsNone, IgnoreCase, Multiline, ExplicitCapture, Compiled, Singleline, IgnorePatternWhitespace, RightToLeft, ECMAScript, CultureInvariant, NonBacktrackingOptions for RegEx.IsMatch; pbiplint runs IgnoreCase and None. pbiplint runs only None and IgnoreCase.

Tokenize()

Each token Tokenize() gives has these members.

MemberTypeWhat it is
TypeInt32The token's type, as a code to compare with a type name: Type == STRING_LITERAL. A type named as a keyword or a .NET type of the expression, such as NOT, TRUE or CONVERT, does not read as the token type there; compare Text.ToUpper() instead.
TextStringThe token's text; for a string literal, its content without the quotes.
NextDaxToken?The next token that is neither white space nor a comment, or null at the end.

The token types, by name:

SINGLE_LINE_COMMENT, DELIMITED_COMMENT, WHITESPACES, DATE_LITERAL, INTEGER_LITERAL, REAL_LITERAL, STRING_LITERAL, TABLE, COLUMN_OR_MEASURE, TABLE_OR_VARIABLE, OPEN_CURLY, CLOSE_CURLY, OPEN_PARENS, CLOSE_PARENS, COMMA, PLUS, MINUS, STAR, DIV, CARET, AMP, LT, GT, OP_AND, OP_OR, OP_NE, OP_LE, OP_GE, LAMBDA, COLON, EQ, VAR, RETURN, IN, DEFINE, EVALUATE, ORDER, BY, ASC, DESC, START, AT, MEASURE, COLUMN, NOT, TRUE, FALSE, AND, OR, ABS, ACCRINT, ACCRINTM, ACOS, ACOSH, ACOT, ACOTH, ADDCOLUMNS, ADDMISSINGITEMS, ALL, ALLCROSSFILTERED, ALLEXCEPT, ALLNOBLANKROW, ALLSELECTED, AMORDEGRC, AMORLINC, APPROXIMATEDISTINCTCOUNT, ASIN, ASINH, ATAN, ATANH, AVERAGE, AVERAGEA, AVERAGEX, BITAND, BITLSHIFT, BITOR, BITRSHIFT, BITXOR, BLANK, CALCULATE, CALCULATETABLE, CALENDAR, CALENDARAUTO, CEILING, CHISQ, CLOSINGBALANCEMONTH, CLOSINGBALANCEQUARTER, CLOSINGBALANCEYEAR, COALESCE, COLUMNSTATISTICS, COMBIN, COMBINA, COMBINEVALUES, CONCATENATE, CONCATENATEX, CONFIDENCE, CONTAINS, CONTAINSROW, CONTAINSSTRING, CONTAINSSTRINGEXACT, CONVERT, COS, COSH, COT, COTH, COUNT, COUNTA, COUNTAX, COUNTBLANK, COUNTROWS, COUNTX, COUPDAYBS, COUPDAYS, COUPDAYSNC, COUPNCD, COUPNUM, COUPPCD, CROSSFILTER, CROSSJOIN, CUMIPMT, CUMPRINC, CURRENCY, CURRENTGROUP, CUSTOMDATA, DATATABLE, DATE, DATEADD, DATEDIFF, DATESBETWEEN, DATESINPERIOD, DATESMTD, DATESQTD, DATESYTD, DATEVALUE, DAY, DB, DDB, DEGREES, DETAILROWS, DISC, DISTINCT, DISTINCTCOUNT, DISTINCTCOUNTNOBLANK, DIVIDE, DOLLARDE, DOLLARFR, DURATION, EARLIER, EARLIEST, EDATE, EFFECT, ENDOFMONTH, ENDOFQUARTER, ENDOFYEAR, EOMONTH, ERROR, EVALUATEANDLOG, EVEN, EXACT, EXCEPT, EXP, EXPON, EXTERNALMEASURE, FACT, FILTER, FILTERS, FIND, FIRST, FIRSTDATE, FIRSTNONBLANK, FIRSTNONBLANKVALUE, FIXED, FLOOR, FORMAT, FV, GCD, GENERATE, GENERATEALL, GENERATESERIES, GEOMEAN, GEOMEANX, GROUPBY, HASONEFILTER, HASONEVALUE, HOUR, IF, IFERROR, IGNORE, INDEX, INFO, INT, INTERSECT, INTRATE, IPMT, ISAFTER, ISBLANK, ISCROSSFILTERED, ISEMPTY, ISERROR, ISEVEN, ISFILTERED, ISINSCOPE, ISLOGICAL, ISNONTEXT, ISNUMBER, ISO, ISODD, ISONORAFTER, ISPMT, ISSELECTEDMEASURE, ISSUBTOTAL, ISTEXT, KEEPFILTERS, LAST, LASTDATE, LASTNONBLANK, LASTNONBLANKVALUE, LCM, LEFT, LEN, LINEST, LINESTX, LN, LOG, LOG10, LOOKUP, LOOKUPVALUE, LOWER, MATCHBY, MAX, MAXA, MAXX, MDURATION, MEDIAN, MEDIANX, MID, MIN, MINA, MINUTE, MINX, MOD, MONTH, MOVINGAVERAGE, MROUND, NATURALINNERJOIN, NATURALLEFTOUTERJOIN, NETWORKDAYS, NEXT, NEXTDAY, NEXTMONTH, NEXTQUARTER, NEXTYEAR, NOMINAL, NONVISUAL, NOW, NPER, OCT, ODD, ODDFPRICE, ODDFYIELD, ODDLPRICE, ODDLYIELD, OFFSET, OPENINGBALANCEMONTH, OPENINGBALANCEQUARTER, OPENINGBALANCEYEAR, ORDERBY, PARALLELPERIOD, PARTITIONBY, PATH, PATHCONTAINS, PATHITEM, PATHITEMREVERSE, PATHLENGTH, PDURATION, PERMUT, PI, PMT, POWER, PPMT, PREVIOUS, PREVIOUSDAY, PREVIOUSMONTH, PREVIOUSQUARTER, PREVIOUSYEAR, PRICE, PRICEDISC, PRICEMAT, PRODUCT, PRODUCTX, PV, QUARTER, QUOTIENT, RADIANS, RAND, RANDBETWEEN, RANGE, RANK, RANKX, RATE, RECEIVED, RELATED, RELATEDTABLE, REMOVEFILTERS, REPLACE, REPT, RIGHT, ROLLUP, ROLLUPADDISSUBTOTAL, ROLLUPGROUP, ROLLUPISSUBTOTAL, ROUND, ROUNDDOWN, ROUNDUP, ROW, ROWNUMBER, RRI, RUNNINGSUM, SAMEPERIODLASTYEAR, SAMPLE, SEARCH, SECOND, SELECTCOLUMNS, SELECTEDMEASURE, SELECTEDMEASUREFORMATSTRING, SELECTEDMEASURENAME, SELECTEDVALUE, SIGN, SIN, SINH, SLN, SQRT, SQRTPI, STARTOFMONTH, STARTOFQUARTER, STARTOFYEAR, SUBSTITUTE, SUBSTITUTEWITHINDEX, SUM, SUMMARIZE, SUMMARIZECOLUMNS, SUMX, SWITCH, SYD, TAN, TANH, TBILLEQ, TBILLPRICE, TBILLYIELD, TIME, TIMEVALUE, TOCSV, TODAY, TOJSON, TOPN, TOPNSKIP, TOTALMTD, TOTALQTD, TOTALYTD, TREATAS, TRIM, TRUNC, UNICHAR, UNICODE, UNION, UPPER, USERCULTURE, USERELATIONSHIP, USERNAME, USEROBJECTID, USERPRINCIPALNAME, UTCNOW, UTCTODAY, VALUE, VALUES, VDB, WEEKDAY, WEEKNUM, WINDOW, XIRR, XNPV, YEAR, YEARFRAC, YIELD, YIELDDISC, YIELDMAT

Regular expressions

These constructs run, each with an example pattern, a text it matches, and one it does not.

ConstructPatternMatchesDoes not match
Literal text"Sales""Total Sales""sales"
., any character but a line feed"a.c""abc""a\u000ac"
|, either side"Sum|Total""Total Cost""Cost"
A group, (...) or (?:...), to repeat or choose within"(?:ab)+c""ababc""ac"
A named group, (?<name>...) or (?'name'...)"(?<year>\d{4})-""2026-11""26-11"
*, none or more"ab*c""ac""adc"
+, one or more"ab+c""abbc""ac"
?, none or one"colou?r""color""colouur"
{n}, {n,} and {n,m}, a counted repeat"^\d{2,4}$""123""12345"
A lazy repeat such as *?, which matches where the greedy one does"a.*?b""axxb""axx"
^ and $, the start and the end (or just before a final line feed)"^Sales$""Sales""Sales Tax"
\A, \z and \Z, the start, the very end, and the end or before a final line feed"\ASales\z""Sales""Sales\u000a"
\b and \B, a word boundary and its opposite"\bID\b""Customer ID""IDENTITY"
A class, [...], with ranges such as a-z"^[A-Z][a-z]+$""Sales""sales"
A negated class, [^...]"^[^0-9]+$""Sales""Q4"
\d, \w and \s, with \D, \W and \S for their opposites, as Unicode defines them"\w+\s\d""Quarter 4""Quarter"
\p{...} and \P{...}, a Unicode general category such as Lu"^\p{Lu}""Sales""sales"
Escapes such as \t, \n, \x41, \u0041 and \."\x41\u0042\.""AB.""AB!"
(?i), ignoring case from there on, and (?i:...) within a group"(?i)total""TOTAL""tot al"
A lookaround one character or one class wide, such as (?=u) or (?<!_)"(?<!_)id""Customer id""_id"
A comment, (?#...)"a(?#note)b""ab""a b"

These are refused, and a rule that uses one stops with the reason.

ConstructPatternReason
An atomic group, (?>...)"(?>ab|a)c"an atomic group (?>...) cannot be translated exactly
A conditional, (?(...)yes|no)"(?(a)b|c)"a conditional (?(...)yes|no) cannot be run
A balancing group, (?<name-other>...)"(?<o>a)(?<c-o>b)"a balancing group (?<name-other>...) cannot be run
The inline options (?m), (?n), (?s) and (?x), and the RegexOptions they stand for"(?m)^Total"the inline option (?m) cannot be run; pbiplint runs only (?i)
A lookaround wider than one character or one class, such as (?=ab)"Total(?=ab)"(?=...) wider than one character or one class cannot be translated exactly
\G, where the last match ended"\Ga"the anchor \G cannot be run
A backreference, \1 or \k<name>"(a)\1"a backreference (\1, \k<name>) cannot be run in linear time
A Unicode block, such as \p{IsGreek}"\p{IsGreek}"the Unicode block \p{IsGreek} cannot be run
\p{Lu}, \p{Ll} or \p{Lt} while case is ignored"(?i)\p{Lu}"\p{Lu} under (?i) cannot be translated exactly
[:name:] inside a class"[[:alpha:]]"[:name:] inside a class cannot be translated exactly
A class subtraction, [...-[...]]"[a-z-[aeiou]]"a class subtraction [...-[...]] cannot be translated exactly

Not run, and why

A rule that uses one of these is one RULE_COULD_NOT_FINISH finding, with this reason.

What the rule usesKindReason
Vertipaq_Cardinalityannotationreads Vertipaq_Cardinality, which needs statistics from a live model that a project's files do not hold; run the rule in Tabular Editor against a deployed model
Vertipaq_RowCountannotationreads Vertipaq_RowCount, which needs statistics from a live model that a project's files do not hold; run the rule in Tabular Editor against a deployed model
Vertipaq_RIViolationInvalidRowsannotationreads Vertipaq_RIViolationInvalidRows, which needs statistics from a live model that a project's files do not hold; run the rule in Tabular Editor against a deployed model
Vertipaq_TableSizeannotationreads Vertipaq_TableSize, which needs statistics from a live model that a project's files do not hold; run the rule in Tabular Editor against a deployed model
Vertipaq_ColumnSizeannotationreads Vertipaq_ColumnSize, which needs statistics from a live model that a project's files do not hold; run the rule in Tabular Editor against a deployed model
Vertipaq_TotalSizeannotationreads Vertipaq_TotalSize, which needs statistics from a live model that a project's files do not hold; run the rule in Tabular Editor against a deployed model
LongLengthRowCountannotationreads LongLengthRowCount, which needs statistics from a live model that a project's files do not hold; run the rule in Tabular Editor against a deployed model
DateTimeWithHourMinSecannotationreads DateTimeWithHourMinSec, which needs statistics from a live model that a project's files do not hold; run the rule in Tabular Editor against a deployed model
Statepropertyreads State, which is kept by the server for a deployed model and is not in a project's files
ErrorMessagepropertyreads ErrorMessage, which is kept by the server for a deployed model and is not in a project's files
RefreshedTimepropertyreads RefreshedTime, which is kept by the server for a deployed model and is not in a project's files
ModifiedTimepropertyreads ModifiedTime, which is kept by the server for a deployed model and is not in a project's files
StructureModifiedTimepropertyreads StructureModifiedTime, which is kept by the server for a deployed model and is not in a project's files
Vertipaq_*annotationreads Vertipaq_*, which needs statistics from a live model that a project's files do not hold; run the rule in Tabular Editor against a deployed model
PagescopeThe rule's Scope names a report object (Page). Tabular Editor's rules check the semantic model; report rules use fab-inspector's format.
VisualscopeThe rule's Scope names a report object (Visual). Tabular Editor's rules check the semantic model; report rules use fab-inspector's format.
CustomVisualscopeThe rule's Scope names a report object (CustomVisual). Tabular Editor's rules check the semantic model; report rules use fab-inspector's format.
FilterscopeThe rule's Scope names a report object (Filter). Tabular Editor's rules check the semantic model; report rules use fab-inspector's format.
ReportscopeThe rule's Scope names a report object (Report). Tabular Editor's rules check the semantic model; report rules use fab-inspector's format.
CalculationGroupTablescopeThe rule's Scope names a scope Tabular Editor does not define: CalculationGroupTable. For CalculationGroupTable, use CalculationGroup. Scope is a comma-separated list of names such as Model, Table, Column, Measure, Partition, or Relationship.
FunctionscopeThe rule's Scope names a scope Tabular Editor does not define: Function. For Function, use UserDefinedFunction. Scope is a comma-separated list of names such as Model, Table, Column, Measure, Partition, or Relationship.
RolescopeThe rule's Scope names a scope Tabular Editor does not define: Role. For Role, use ModelRole. Scope is a comma-separated list of names such as Model, Table, Column, Measure, Partition, or Relationship.
DataSourcescopeThe rule's Scope names a scope Tabular Editor does not define: DataSource. For DataSource, use ProviderDataSource. Scope is a comma-separated list of names such as Model, Table, Column, Measure, Partition, or Relationship.
ExpressionscopeThe rule's Scope names a scope Tabular Editor does not define: Expression. For Expression, use NamedExpression. Scope is a comma-separated list of names such as Model, Table, Column, Measure, Partition, or Relationship.
x => ...syntaxa named lambda parameter ('x => ...'), which Tabular Editor does not run; write the body with 'it' instead
Object(...)syntaxconverting to Object with Object(...) is not supported; use Convert
Boolean(...)syntaxconverting to Boolean with Boolean(...) is not supported; use Convert
String(...)syntaxconverting to String with String(...) is not supported; use Convert
DateTime(...)syntaxconverting to DateTime with DateTime(...) is not supported; use Convert
DateTimeOffset(...)syntaxconverting to DateTimeOffset with DateTimeOffset(...) is not supported; use Convert
TimeSpan(...)syntaxconverting to TimeSpan with TimeSpan(...) is not supported; use Convert
Guid(...)syntaxconverting to Guid with Guid(...) is not supported; use Convert
.Single(...)syntaxcollection has no method Single
.SingleOrDefault(...)syntaxcollection has no method SingleOrDefault
.SelectMany(...)syntaxcollection has no method SelectMany
.ThenBy(...)syntaxcollection has no method ThenBy
.ThenByDescending(...)syntaxcollection has no method ThenByDescending
.TakeWhile(...)syntaxcollection has no method TakeWhile
.SkipWhile(...)syntaxcollection has no method SkipWhile
.GroupBy(...)syntaxcollection has no method GroupBy
.DistinctBy(...)syntaxcollection has no method DistinctBy
RegexOptions.MultilineoptionRegEx.IsMatch was given RegexOptions.Multiline, which pbiplint does not run; only IgnoreCase and None are
RegexOptions.ExplicitCaptureoptionRegEx.IsMatch was given RegexOptions.ExplicitCapture, which pbiplint does not run; only IgnoreCase and None are
RegexOptions.CompiledoptionRegEx.IsMatch was given RegexOptions.Compiled, which pbiplint does not run; only IgnoreCase and None are
RegexOptions.SinglelineoptionRegEx.IsMatch was given RegexOptions.Singleline, which pbiplint does not run; only IgnoreCase and None are
RegexOptions.IgnorePatternWhitespaceoptionRegEx.IsMatch was given RegexOptions.IgnorePatternWhitespace, which pbiplint does not run; only IgnoreCase and None are
RegexOptions.RightToLeftoptionRegEx.IsMatch was given RegexOptions.RightToLeft, which pbiplint does not run; only IgnoreCase and None are
RegexOptions.ECMAScriptoptionRegEx.IsMatch was given RegexOptions.ECMAScript, which pbiplint does not run; only IgnoreCase and None are
RegexOptions.CultureInvariantoptionRegEx.IsMatch was given RegexOptions.CultureInvariant, which pbiplint does not run; only IgnoreCase and None are
RegexOptions.NonBacktrackingoptionRegEx.IsMatch was given RegexOptions.NonBacktracking, which pbiplint does not run; only IgnoreCase and None are
FixExpressionfieldpbiplint reports findings and never changes the model, so a fix is not run.
CompatibilityLevelfieldpbiplint runs the rule whatever the model's compatibility level.

Limits

LimitValueWhat it holds
fileBytes1,048,576The most bytes a rule file may hold; a larger file stops the project's lint, naming it.
rulesPerFile2,000The most rules read from one file; each rule after that is reported as not read.
expressionChars20,000The longest Expression, in characters; a longer one is reported as not read.
nesting100How deeply an Expression, or the groups of a regular expression, may nest; deeper stops the rule.
patternChars4,000The longest regular expression, in characters; a longer one stops the rule.
patternStates10,000The most states a regular expression may compile to; large repeat counts such as {1000} reach it, and it stops the rule.
stepsPerRule20,000,000The evaluation steps one rule may take over the whole model, regular expressions included; a rule that reaches it stops.