Rules / Formatting

Provide format string for "Month" columns

info MONTHCOLUMN_FORMATSTRING · ported · model layer · scope: Column, CalculatedColumn, CalculatedTableColumn

What it checks

DateTime columns with month in the name whose format string is not exactly MMMM yyyy.

Each finding names the column, as 'Date'[Month Start]. The line does not say what the format string was, only that it is not the expected one.

Example

Fires the rule
table Date
	column Date
		dataType: dateTime
		isKey
		formatString: mm/dd/yyyy
		summarizeBy: none
		sourceColumn: Date

	column 'Month Start'
		dataType: dateTime
		summarizeBy: none
		sourceColumn: Month Start
After the fix
table Date
	column Date
		dataType: dateTime
		isKey
		formatString: mm/dd/yyyy
		summarizeBy: none
		sourceColumn: Date

	column 'Month Start'
		dataType: dateTime
		formatString: MMMM yyyy
		summarizeBy: none
		sourceColumn: Month Start

Why it matters

A DateTime column named Month usually holds the first day of each month, and with a default date format it reads as March 1, 2026 rather than March 2026. The MMMM yyyy format shows the month and year, and setting it on the column fixes every visual at once.

How to fix it

In Power BI Desktop, select the column in the Data pane and set Format under Column tools. In the TMDL file, add formatString: MMMM yyyy under the column. The column keeps its DateTime type and its value, so it still sorts chronologically and still works in a relationship to the date table; only what a visual prints changes.

When to ignore it

A DateTime column with month in its name that holds a full date, not a month start, is the case to leave alone: formatting Month End Date as MMMM yyyy throws away the day, which is the part a reader needs. House style is the other case, where a model already writes its month labels as MMM yyyy and changing them would leave two conventions in the same report. A hidden month column shows nothing to anyone, so its format string is not worth a change on its own.

To ignore this rule on one object, add annotation pbiplint.ignore = MONTHCOLUMN_FORMATSTRING under the object in its TMDL file. Power BI Desktop keeps the annotation. To turn the rule off for a whole project, set "MONTHCOLUMN_FORMATSTRING": "off" under rules in pbiplint.config.json.

Quirks

Ported from Microsoft's Best Practice Analyzer ruleset (opens in a new tab).

Check a model for this Improve this page (opens in a new tab)