uid | category | sub-category | title | author | updated |
---|---|---|---|---|---|
DI003 |
Code actions |
Improvements |
Remove table name |
Daniel Otykier |
2024-12-19 |
Code action DI003
(Improvement) Remove table name from measure references
Measure references should not include the table name, as the table name is unnecessary when referencing measures.
Change:
'Internet Sales'[Internet Total Sales] * 1.25
To:
[Internet Total Sales] * 1.25
In most situations, column references must be qualified by the table name. However, for measure references, the table name is always optional (since measure names are always unique within a model).
Thus, a best practice is to always reference measures without the table name, and always reference columns with the table name.
By applying this practice consistently, you make your code more concise and easier to read, and you make it easier to distinguish between measure references and column references.
This code action has an (All occurrences) variant, which will appear when multiple sections of code can be improved. This variant will apply the code action to all relevant sections of the document at once.
- DI004 - Add table name to column references