TabularEditor / BestPracticeRules

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

Define Detail Rows if referenced measures use it #5

Open marcosqlbi opened 7 years ago

marcosqlbi commented 7 years ago

Define Detail Rows if a measure depends on one or more other measures that have Detail Rows property defined.

otykier commented 7 years ago

Hi Marco. Just to clarify. Assume I have the following measures and dependencies:

image

and Detail Rows have been defined at the top-most measure [Reseller Total Sales].

Should the rule then output all measures that depend on [Reseller Total Sales] recursively, or just the measures that reference it directly? I guess in the former case, the rule could potentially output many measures that would be in violation of the rule, and it would not always be clear why, where as in the latter case, the rule would have to be re-evaluated continuously while new Detail Rows expressions are added...

marcosqlbi commented 7 years ago

Good point. I think that providing the warning at the first level is the right thing to do. However, we should figure out how to "disable" the warning for specific measures. I don't know whether we might use some annotation or some comment in the measure. For example, if it's ok that Total Sales doesn't provide the warning, I would like to mark Total Sales in some way, so that Reseller Current Quarter Sales still generates the warning (unless I disable that measure as well).

otykier commented 7 years ago

This is already possible today. In the screenshot below, you can see that I've already ignored the rule for the [Total Sales] measure (shown in the Property Grid). As you can see, an annotation has been added to the measure, specifying the ID's of the rules that should be ignored:

image

One more question: Should the rule ignore measures residing on a table that has a Default Detail Rows Expression defined?

marcosqlbi commented 7 years ago

Believe it or not, I missed the "Default Detail Rows Expression"! Ok, I would do the following (but I'm very open to discuss it because I never spent too much time on this):

Feedback is welcome - we are in unexplored territories here.

otykier commented 7 years ago

I agree with your 3rd bullet, since we have to assume that, in general, if measure B depends on A, it must mean that B is a more "specialized" case of A. And so any "specialization" (in this case, Detail Row Expression different from the table default) that has been explicitly set on A, should also prompt us to consider doing something to B.

marcosqlbi commented 7 years ago

This is also my feeling. Not sure how it can be implemented, but it is a "nice to have" feature,