TabularEditor / BestPracticeRules

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

[Rule Request] Hide foreign key columns #48

Open lbeneyze opened 3 years ago

lbeneyze commented 3 years ago

Good morning,

Firstly, I really like the effort the communities to elevate the Power BI development level. Keep up the good job. I'm trying for the first time the BPA and struggling with the rule "Hide foreign key columns". I'm also new to LINQ. I've paste the below formula found here (https://docs.tabulareditor.com/Best-Practice-Analyzer.html#fixing-objects) "Model.Relationships.Any(FromColumn = outerIt) and not IsHidden and not Table.IsHidden" and I got the error message "Operator '=' incompatible with operand types "Column" and Model""

Thanks in advance for letting me know.

Kind regards, Lohic Beneyzet

m-kovalsky commented 3 years ago

You must select the appropriate objects within the 'Applies to' dropdown in the 'Edit Best Practice Rule' window. 'Model' is checked by default so you must uncheck it in this scenario (since this rule should apply to columns only). This rule should apply to 'Calculated Columns', 'Calculated Table Columns', and 'Data Columns'.