TabularEditor / BestPracticeRules

An official collection of standard Rules for use with Tabular Editor's Best Practice Analyzer.
122 stars 53 forks source link

[Rule Request] Ignore Comment in DIVISION Rule #26

Closed Daandamhuis closed 5 years ago

Daandamhuis commented 5 years ago

Hi,

Is it possible to exclude comments in calculated items (measures, columns, tables etc.)? We use them allot to give some extra context when needed. For example

SUMMARIZECOLUMNS ( 'Sales'[Posting Date], 'Sales'[Customer No], 'Sales'[Item No], 'Sales'[VAT Rate], 'Sales'[Currency Code], / Makes sure that issues with currency conversions are filtered out. / FILTER ( 'Sales', 'Sales'[Selling Price (EUR)] < 1000 ) )

otykier commented 5 years ago

Hi @Daandamhuis. This is actually possible using version 2.8.1 of Tabular Editor, thanks to the new .Tokenize() method. See #20 for a couple of examples of how to write the rule expression to achieve this.

otykier commented 5 years ago

I updated the rule file to use the Tokenize() method: https://github.com/TabularEditor/BestPracticeRules/blob/master/src/standard/DAX%20Expressions/DAX_DIVISION_COLUMNS.json

Daandamhuis commented 5 years ago

Thanks for the reply, this saves my day. (And thanks by the way for the awsome repo!) Saves me a lot of work each release.