Skip to content

Commit c4b3a96

Browse files
committed
Fixed typos
1 parent d6c766d commit c4b3a96

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

_mydocs/dax-style/dax-naming-conventions.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,38 @@
11
---
22
layout: page
3-
title: DAX naming conventions
3+
title: DAX Naming Conventions
44
published: true
55
order: /
66
---
77

88
The naming conventions for DAX coding in reality involve many objects of the semantic model and reflect the need of exposing clear names to the user and to keep the code readable and maintainable. The following sections describe the conventions for the main DAX and semantic model objects.
99

10-
# Golden rules for all objects
10+
## Golden rules for all objects
1111
- All names should be written using names that are clear for the business users and understandable in the reports.
1212
- Avoid using abbreviations or acronyms unless they are widely recognized and understood by the business users.
1313

14-
# Tables
14+
## Tables
1515
- Do not use any technical prefix, like `dim` or `fact`.
1616
- Use a single noun when possible for a table name.
1717
- When more words are part of a table name, separate them by using a space if the table may be visible to the users, like `Coupons Orders`.
1818
- You might use PascalCase (e.g., `PricingConfiguration`) if the table name is designed to be invisible to the user.
1919
- Use singular nouns for qualitative business entities (e.g., `Customer`, `Product`, `Sales Region`).
2020
- Use uncountable or plural nouns for quantitative business entities (e.g., `Sales`, `Inventory`, `Revenue`, `Movements`).
2121

22-
# Columns
22+
## Columns
2323
- Do not use any technical prefix, like `date` or `string`.
2424
- Use a single noun when possible for a column name.
2525
- When more words are part of a column name, separate them by using a space if the table may be visible to the users, like `Coupons Orders`.
2626
- You might use PascalCase (e.g., `PricingConfiguration`) if the column name is designed to be invisible to the user.
2727

28-
# Measures
28+
## Measures
2929
- The measure name should clearly describe its result.
3030
- When more words are part of a measure name, separate them by using a space if the measure may be visible to the users, like `Sales Amount`.
3131
- You might use PascalCase (e.g., `SalesAmount`) if the measure name is designed to be invisible to the user.
3232
- Consider common acronyms that are widely recognized and understood by the business users, like `ROI` or `YOY`.
3333
- Use time intelligence acronyms like `YTD`, `QTD`, `MTD`, `PY`, `LY` as a suffix, like `Sales Amount YTD` or `Sales Amount PY`. A common list of time intelligence acronyms is provided below:
34+
35+
3436
| Acronym | Meaning |
3537
|---------|---------|
3638
| YTD | Year-to-date |
@@ -60,17 +62,17 @@ The naming conventions for DAX coding in reality involve many objects of the sem
6062
| QTDOPQ | Quarter-to-date-over-previous-quarter |
6163
| MTDOPM | Month-to-date-over-previous-month |
6264

63-
# Variables
65+
## Variables
6466
- Variable names should be written in PascalCase.
6567
- Define a last variable named Result to hold the final result of the measure or expression.
6668
- This allows to quickly restore the expression logic when editing it for debugging purposes.
6769
- You may use a prefix like `_` (underscore) for variable names.
6870
- While this was required to avoid possible name conflicts in the past, it is no longer necessary.
6971
- However, it can still be useful to visually distinguish variables from other objects in the code.
7072

71-
# User-defined functions
73+
## User-defined functions
7274

73-
## Function names
75+
### Function names
7476
- Function names should be written in PascalCase.
7577
- The dot character (.) is permitted within function names and is recommended for delineating categories.
7678
- This serves as an effective analogue to namespaces commonly found in many programming languages.
@@ -92,7 +94,7 @@ The naming conventions for DAX coding in reality involve many objects of the sem
9294
- You cannot use `Dax` as a noun part of the function name, as Microsoft reserves it.
9395
- You should not use `DaxLib` as an initial prefix for a function name, as it is reserved for general-purpose libraries maintained by the [DAX Lib](https://daxlib.org) community.
9496

95-
## Parameters
97+
### Parameters
9698
- Use [camelCase](https://en.wikipedia.org/wiki/Camel_case) for parameter names.
9799
- Include a suffix indicating the parameter type for `EXPR` parameters:
98100
- `Column` for a column reference.
@@ -105,7 +107,7 @@ As a result, `YearlySales` is interpreted as a variable, whereas `yearlySales` i
105107

106108
Examples of `EXPR` parameter names are: `lookupTable`, `listPriceColumn`, `amountMeasure`, `metricExpr`.
107109

108-
## Comments
110+
### Comments
109111

110112
Comments describing functions are typically introduced with a triple forward slash (///) directly before the function declaration. This notation serves to document the function’s purpose. For example, the following function converts the temperature from Celsius to Fahrenheit:
111113
```

0 commit comments

Comments
 (0)