# DAX Math & Trigonometric - GCD function

## Description

Returns the greatest common divisor of two integers.

DAX GCD function is new in Excel 2016.

## Syntax

```GCD (<number1>, <number2>)
```

## Parameters

Sr.No. Parameter & Description
1

number1

A positive number.

2

number2

A positive number.

## Return Value

A positive integer.

## Remarks

The greatest common divisor is the largest integer that divides both number1 and number2 without a remainder.

• If any of the parameters is not an integer, it will be rounded.

• If any of the parameters is negative, the function returns error.

• If any of the parameters is non-numeric, the function returns error.

• If the parameters do not have a common divisor > 1, the function returns 1.

## Example

```= GCD (16,20) returns 4.
= GCD (15,25) returns 5.
```
dax_functions_mathematical_trigonometric.htm

## Useful Video Courses

Video

#### Mastering DAX and Data Models in Power BI Desktop

53 Lectures 5.5 hours

Video

#### Mastering DAX Studio

Featured

24 Lectures 2 hours

Video

#### DAX / Power BI - Customer and Sales Analysis Deep Dive

26 Lectures 4.5 hours