From a843782691895116bbb92239525e520aecc23437 Mon Sep 17 00:00:00 2001 From: ricky7uio <44656050+ricky7uio@users.noreply.github.com> Date: Tue, 29 Apr 2025 11:55:06 +0200 Subject: [PATCH] Updated PROVIDE_FORMAT_STRING_FOR_MEASURES rule Updated PROVIDE_FORMAT_STRING_FOR_MEASURES rule to only check for not string measures. It's not logical to check for string format for measures that are strings. e.g. A measure like IF ( condition, "Text", "Different text" ) should not need a format string. --- BestPracticeRules/BPARules.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BestPracticeRules/BPARules.json b/BestPracticeRules/BPARules.json index c8aa0024..22be2456 100644 --- a/BestPracticeRules/BPARules.json +++ b/BestPracticeRules/BPARules.json @@ -615,10 +615,10 @@ "ID": "PROVIDE_FORMAT_STRING_FOR_MEASURES", "Name": "[Formatting] Provide format string for measures", "Category": "Formatting", - "Description": "Visible measures should have their format string property assigned", + "Description": "Visible not string measures should have their format string property assigned", "Severity": 3, "Scope": "Measure", - "Expression": "not IsHidden \r\nand not Table.IsHidden \r\nand string.IsNullOrWhitespace(FormatString)", + "Expression": "not IsHidden \r\nand not Table.IsHidden \r\nand string.IsNullOrWhitespace(FormatString)\r\nand DataType <> \"String\"", "CompatibilityLevel": 1200 }, { @@ -724,4 +724,4 @@ "Expression": "Name.ToUpper().Contains(\"MONTH\")\r\nand\r\n! Name.ToUpper().Contains(\"MONTHS\") \r\nand \r\n\n\nDataType == DataType.String \r\nand \r\nSortByColumn == null", "CompatibilityLevel": 1200 } -] \ No newline at end of file +]