Rules / Formatting
Provide format string for "Month" columns
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
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
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
- The name test is a substring matched without regard to letter case, so any DateTime column with month in its name is checked, including Month End Date and a Bimonthly Cutoff column.
- Only the exact string
MMMM yyyypasses, and the comparison is case-sensitive, so a format string that differs from it only in letter case is still reported. - Only DateTime columns are read. A month held as text or as a whole number is not reported here.
- Hidden columns, and columns in hidden tables, are in scope.
- A column with no
dataTypeline, as Power BI Desktop saves most calculated columns, is not reported, since pbiplint does not know its type. Tabular Editor reads the type from the column's DAX.
Related rules
DATECOLUMN_FORMATSTRINGreads the same DateTime columns for date in the name and wantsmm/dd/yyyy. A column called Month End Date is reported by both rules, and no single format string clears the two, so one of them has to be ignored on that column.
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)