Skip to content

Commit 945c2f5

Browse files
Merge pull request #387 from MicrosoftDocs/main639046945286319830sync_temp
For protected branch, push strategy should use PR and merge to target branch method to work around git push error
2 parents ba48dc8 + 06d762f commit 945c2f5

8 files changed

Lines changed: 34 additions & 20 deletions

query-languages/dax/allselected-function-dax.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ ALLSELECTED([<tableName> | <columnName>[, <columnName>[, <columnName>[,…]]]] )
2222

2323
|Term|Definition|
2424
|--------|--------------|
25-
|`tableName`|The name of an existing table, using standard DAX syntax. This parameter cannot be an expression. This parameter is optional. |
26-
|`columnName`|The name of an existing column using standard DAX syntax, usually fully qualified. It cannot be an expression. This parameter is optional. |
25+
|`tableName`|The name of an existing table using DAX syntax. This parameter cannot be an expression. This parameter is optional. |
26+
|`columnName`|The name of an existing column using DAX syntax, usually fully qualified. It cannot be an expression. This parameter is optional. |
2727

2828
## Return value
2929

query-languages/dax/distinctcount-function-dax.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,21 @@ Using the above measure in a table with calendar year in the side and product ca
5252
||||||1|1|
5353
|**Grand Total**|**1315**|**3153**|**2410**|**2646**|**1**|**3797**|
5454

55-
In the above example, note that the rows Grand Total numbers do not add up, this happens because the same order might contain line items, in the same order, from different product categories.
55+
### Understanding distinct count totals
56+
57+
Distinct count totals are not additive. The Grand Total is not the sum of the values in each category.
58+
59+
In the table above, you might expect the Grand Total for 2005 (366) to equal the sum of Accessories (135) + Bikes (345) + Clothing (242) + Components (205) = 927. However, the actual Grand Total is 366, which is much lower.
60+
61+
This happens because the same order can appear in multiple categories. For example, if order #1001 contains both a bike and an accessory, that order is counted once in the Bikes column and once in the Accessories column. But when calculating the Grand Total for the row, order #1001 is only counted once because it's still just one distinct order.
62+
63+
This is the correct and expected behavior of distinct counts:
64+
65+
- **Category values**: Count distinct orders within that specific category only.
66+
- **Row totals**: Count distinct orders across all categories for that year - each order is counted only once, regardless of how many categories it appears in.
67+
- **Grand Total**: Count distinct orders across the entire dataset.
68+
69+
If you need totals that add up, consider using [COUNT](count-function-dax.md) or [COUNTROWS](countrows-function-dax.md) instead. However, be aware that these functions count rows, not distinct values, and will give different results.
5670

5771
## Related content
5872

query-languages/dax/gcd-function-dax.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ Returns the greatest common divisor of two or more integers. The greatest common
1212
## Syntax
1313

1414
```dax
15-
GCD(number1, [number2], ...)
15+
GCD(number1, number2)
1616
```
1717

1818
### Parameters
1919

2020
|Term|Definition|
2121
|--------|--------------|
22-
|`number1, number2, ...`|Number1 is required, subsequent numbers are optional. 1 to 255 values. If any value is not an integer, it is truncated.|
22+
|`number1, number2`|The two integers for which you want the greatest common divisor. If a value is not an integer, it is truncated.|
2323

2424
## Return value
2525

query-languages/dax/lcm-function-dax.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ Returns the least common multiple of integers. The least common multiple is the
1212
## Syntax
1313

1414
```dax
15-
LCM(number1, [number2], ...)
15+
LCM(number1, number2)
1616
```
1717

1818
### Parameters
1919

2020
|Term|Definition|
2121
|--------|--------------|
22-
|`number1, number2,...`|Number1 is required, subsequent numbers are optional. 1 to 255 values for which you want the least common multiple. If value is not an integer, it is truncated.|
22+
|`number1, number2`|The two integers for which you want the least common multiple. If a value is not an integer, it is truncated.|
2323

2424
## Return value
2525

query-languages/dax/previousyear-function-dax.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ ms.topic: reference
77

88
[!INCLUDE[applies-to-measures-columns-tables-visual-calculations-discouraged](includes/applies-to-measures-columns-tables-visual-calculations-discouraged.md)]
99

10-
For date column input, Returns a table that contains a column of all dates from the previous year, given the last date in the `dates` column, in the current context.
10+
For date column input, returns a table that contains a column of all dates from the previous year, based on the first date in the `dates` column, in the current context.
1111

12-
For calendar input, returns all dates from the previous year, based on the first date in the current context. The table contains all primary tagged columns and all time related columns
12+
For calendar input, returns all dates from the previous year, based on the first date in the current context. The table contains all primary tagged columns and all time related columns.
1313

1414
## Syntax
1515

@@ -31,7 +31,7 @@ For calendar input, a table that contains all primary tagged columns and all tim
3131

3232
## Remarks
3333

34-
- This function returns all dates from the previous year given the latest date in the input parameter. For example, if the latest date in the `dates` argument refers to the year 2009, then this function returns all dates for the year of 2008, up to the specified `year_end_date`.
34+
- This function returns all dates from the previous year based on the first date in the input parameter. For example, if the first date in the `dates` argument refers to the year 2009, then this function returns all dates for the year of 2008, up to the specified `year_end_date`.
3535

3636
- The `dates` argument can be any of the following:
3737
- A reference to a date/time column.

query-languages/dax/time-intelligence-functions-dax.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ Data Analysis Expressions (DAX) includes time-intelligence functions that enable
2828
|[ENDOFYEAR](endofyear-function-dax.md) | Returns the last date of the year in the current context for the specified column of dates. |
2929
|[FIRSTDATE](firstdate-function-dax.md) | Returns the first date in the current context for the specified column of dates. |
3030
|[LASTDATE](lastdate-function-dax.md) | Returns the last date in the current context for the specified column of dates. |
31-
|[NEXTDAY](nextday-function-dax.md) | Returns a table that contains a column of all dates from the next day, based on the first date specified in the dates column in the current context. |
32-
|[NEXTWEEK](nextweek-function-dax.md) | Returns a table that contains a column of all dates from the next week, based on the first date in the dates column in the current context. |
33-
|[NEXTMONTH](nextmonth-function-dax.md) | Returns a table that contains a column of all dates from the next month, based on the first date in the dates column in the current context. |
34-
|[NEXTQUARTER](nextquarter-function-dax.md) | Returns a table that contains a column of all dates in the next quarter, based on the first date specified in the dates column, in the current context. |
35-
|[NEXTYEAR](nextyear-function-dax.md) | Returns a table that contains a column of all dates in the next year, based on the first date in the dates column, in the current context. |
31+
|[NEXTDAY](nextday-function-dax.md) | Returns a table that contains a column of all dates from the next day, based on the last date specified in the dates column in the current context. |
32+
|[NEXTWEEK](nextweek-function-dax.md) | Returns a table that contains a column of all dates from the next week, based on the last date in the dates column in the current context. |
33+
|[NEXTMONTH](nextmonth-function-dax.md) | Returns a table that contains a column of all dates from the next month, based on the last date in the dates column in the current context. |
34+
|[NEXTQUARTER](nextquarter-function-dax.md) | Returns a table that contains a column of all dates in the next quarter, based on the last date specified in the dates column, in the current context. |
35+
|[NEXTYEAR](nextyear-function-dax.md) | Returns a table that contains a column of all dates in the next year, based on the last date in the dates column, in the current context. |
3636
|[OPENINGBALANCEWEEK](openingbalanceweek-function-dax.md) | Evaluates the expression at the first date of the week in the current context. |
3737
|[OPENINGBALANCEMONTH](openingbalancemonth-function-dax.md) | Evaluates the expression at the first date of the month in the current context. |
3838
|[OPENINGBALANCEQUARTER](openingbalancequarter-function-dax.md) | Evaluates the expression at the first date of the quarter, in the current context. |
@@ -42,7 +42,7 @@ Data Analysis Expressions (DAX) includes time-intelligence functions that enable
4242
|[PREVIOUSWEEK](previousweek-function-dax.md) | Returns a table that contains a column of all dates representing the week that is previous to the first date in the dates column, in the current context. |
4343
|[PREVIOUSMONTH](previousmonth-function-dax.md) | Returns a table that contains a column of all dates from the previous month, based on the first date in the dates column, in the current context. |
4444
|[PREVIOUSQUARTER](previousquarter-function-dax.md) | Returns a table that contains a column of all dates from the previous quarter, based on the first date in the dates column, in the current context. |
45-
|[PREVIOUSYEAR](previousyear-function-dax.md) | Returns a table that contains a column of all dates from the previous year, given the last date in the dates column, in the current context. |
45+
|[PREVIOUSYEAR](previousyear-function-dax.md) | Returns a table that contains a column of all dates from the previous year, based on the first date in the dates column, in the current context. |
4646
|[SAMEPERIODLASTYEAR](sameperiodlastyear-function-dax.md) | Returns a table that contains a column of dates shifted one year back in time from the dates in the specified dates column, in the current context. |
4747
|[STARTOFWEEK](startofweek-function-dax.md) | Returns the first date of the week in the current context for the specified column of dates. |
4848
|[STARTOFMONTH](startofmonth-function-dax.md) | Returns the first date of the month in the current context for the specified column of dates. |

query-languages/dax/today-function-dax.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ A date (`datetime`).
2121

2222
## Remarks
2323

24-
- The TODAY function is useful when you need to have the current date displayed on a worksheet, regardless of when you open the workbook. It is also useful for calculating intervals.
24+
- The TODAY function is useful when you need to have the current date displayed in a report, regardless of when you open it. It is also useful for calculating intervals.
2525

26-
- If the TODAY function does not update the date when you expect it to, you might need to change the settings that control when the column or workbook is refreshed..
26+
- If the TODAY function does not update the date when you expect it to, you might need to change the settings that control when the report or semantic model is refreshed.
2727

28-
- The NOW function is similar but returns the exact time, whereas TODAY returns the time value 12:00:00 PM for all dates.
28+
- The NOW function is similar but returns the exact time, whereas TODAY returns the time value 12:00:00 AM (midnight) for all dates.
2929

3030
## Example
3131

query-languages/dax/treatas-function-dax.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Applies the result of a table expression as filters to columns from an unrelated
1212
## Syntax
1313

1414
```dax
15-
TREATAS(table_expression, <column>[, <column>[, <column>[,…]]]} )
15+
TREATAS(table_expression, <column>[, <column>[, <column>[,…]]])
1616
```
1717

1818
### Parameters

0 commit comments

Comments
 (0)