Power BI
Needs VotesIntelliSense Should Use Best Practice Column and Measure Naming Conventions
Matt Allington on 28 Mar 2018 05:28:03
There is a clearly defined and accepted best practice for referencing columns and measures in the DAX language.
1. Column names should ALWAYS reference the table name.
TableName[Column Name]
2. Measures should NEVER reference the table name.
[Measure Name]
This is a fundamental concept accepted by everyone with knowledge of the DAX language (everyone I know anyway).
IntelliSense in DAX sometimes follows this convention and sometimes it does not. I have created a short video (40 seconds) showing 3 examples. https://youtu.be/CvaRhKrnHRk
There are other places where column names are appended to measure names too, such as inside Quick Measures, and I have also seen Column Names used without pre-pending the table name.
Microsoft...
Please acknowledge that this is an issue, and
Please fix IntelliSense so it always follows the best practice
- Comments (7)
RE: IntelliSense Should Use Best Practice Column and Measure Naming Conventions
I think that it helps to explain why the convention is the way that it is. A measure just describes a calculation, so it intuitively should not matter in which table it resides, and so the table name is not even important unless the measure has the same name as a column or measure in another table. Columns are an intrinsic part of a table, so it is pretty important to know to which table a column belongs.To add to the suggestion, I feel that the table names used by IntelliSense should always be surrounded by single quotes (e.g. 'Table Name'), even if the table name does not contain spaces. I find it mentally easier to accept the single quotes as part of the syntax for table names rather than keep track of 2 syntaxes. Also, having single quotes around the table name is good for tables that share the same name with functions (e.g. Date, Time). This will prevent confusion with syntax highlighting and IntelliSense.
RE: IntelliSense Should Use Best Practice Column and Measure Naming Conventions
Thanks for this Matt - I'm on your email list so it was a great prompt / call to action! I'll ask my colleagues to support it too,
RE: IntelliSense Should Use Best Practice Column and Measure Naming Conventions
Wow yeah, I was hoping someone made an idea for this. Its driving me nuts. It's so random whether it uses the fully qualified measure names or not. Never ever do I want this PowerBI!Really bad when intellisense is teaching you to write poor DAX :(
RE: IntelliSense Should Use Best Practice Column and Measure Naming Conventions
Also make naming conventions in power query without spaces so the inverted commas and hash aren't need.
RE: IntelliSense Should Use Best Practice Column and Measure Naming Conventions
This is an issue. I hope Microsoft will address and fix this issue!! Thank you.
RE: IntelliSense Should Use Best Practice Column and Measure Naming Conventions
If this isn't implemented, we'll send all Power BI employees the YouTube video of Marco Russo jumping up and down screaming measures can't have table names. Every day.
RE: IntelliSense Should Use Best Practice Column and Measure Naming Conventions
I am with you on this.