Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion BestPracticeRules/BPARules.json
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@
"Description": "Inactive relationships are activated using the USERELATIONSHIP function. If an inactive relationship is not referenced in any measure via this function, the relationship will not be used. It should be determined whether the relationship is not necessary or to activate the relationship via this method.\r\n\r\nReference: https://docs.microsoft.com/power-bi/guidance/relationships-active-inactive\r\nReference: https://dax.guide/userelationship/",
"Severity": 2,
"Scope": "Relationship",
"Expression": "IsActive == false\r\nand not\r\n(\r\nModel.AllMeasures.Any(RegEx.IsMatch(Expression,\r\n\"(?i)USERELATIONSHIP\\s*\\(\\s*\\'*\" +\r\ncurrent.FromTable.Name + \"\\'*\\[\" + \r\ncurrent.FromColumn.Name + \"\\]\\s*,\\s*\\'*\" +\r\ncurrent.ToTable.Name + \"\\'*\\[\" +\r\ncurrent.ToColumn.Name + \"\\]\"))\r\nor\r\nModel.AllCalculationItems.Any(RegEx.IsMatch(Expression,\r\n\"(?i)USERELATIONSHIP\\s*\\(\\s*\\'*\" +\r\ncurrent.FromTable.Name + \"\\'*\\[\" + \r\ncurrent.FromColumn.Name + \"\\]\\s*,\\s*\\'*\" +\r\ncurrent.ToTable.Name + \"\\'*\\[\" +\r\ncurrent.ToColumn.Name + \"\\]\"))\r\n)",
"Expression": "IsActive == false\r\nand not\r\n(\r\n Model.AllMeasures.Any(\r\n RegEx.IsMatch(Expression, \"(?i)USERELATIONSHIP\\s*\\(\\s*'*\" + RegEx.Escape(current.FromTable.Name) + \"'*\\s*\\[\" + RegEx.Escape(current.FromColumn.Name) + \"\\]\\s*,\\s*'*\" + RegEx.Escape(current.ToTable.Name) + \"'*\\s*\\[\" + RegEx.Escape(current.ToColumn.Name) + \"\\]\")\r\n or RegEx.IsMatch(Expression, \"(?i)USERELATIONSHIP\\s*\\(\\s*'*\" + RegEx.Escape(current.ToTable.Name) + \"'*\\s*\\[\" + RegEx.Escape(current.ToColumn.Name) + \"\\]\\s*,\\s*'*\" + RegEx.Escape(current.FromTable.Name) + \"'*\\s*\\[\" + RegEx.Escape(current.FromColumn.Name) + \"\\]\")\r\n )\r\n or Model.AllCalculationItems.Any(\r\n RegEx.IsMatch(Expression, \"(?i)USERELATIONSHIP\\s*\\(\\s*'*\" + RegEx.Escape(current.FromTable.Name) + \"'*\\s*\\[\" + RegEx.Escape(current.FromColumn.Name) + \"\\]\\s*,\\s*'*\" + RegEx.Escape(current.ToTable.Name) + \"'*\\s*\\[\" + RegEx.Escape(current.ToColumn.Name) + \"\\]\")\r\n or RegEx.IsMatch(Expression, \"(?i)USERELATIONSHIP\\s*\\(\\s*'*\" + RegEx.Escape(current.ToTable.Name) + \"'*\\s*\\[\" + RegEx.Escape(current.ToColumn.Name) + \"\\]\\s*,\\s*'*\" + RegEx.Escape(current.FromTable.Name) + \"'*\\s*\\[\" + RegEx.Escape(current.FromColumn.Name) + \"\\]\")\r\n )\r\n)",
"CompatibilityLevel": 1200
},
{
Expand Down