GCD Function (DAX)

How does the GCD function (DAX) work?

The GCD function (DAX) returns the two or more integers largest common divisor. The most common divisor is the largest integer dividing both number1 and number2 without a residual. 

GCD Formula Syntax

GCD(number1, [number2], …)

How do you use the GCD function?

If any argument is nonnumeric, GCD returns the #VALUE! error value.

If any argument is less than zero, GCD returns the #NUM! error value.



Related Blog Posts

Related Support Forum Posts

Understanding DAX Formula
Developing Complex Dax functions

Considerations when using the GCD function

One divides any value evenly.

A prime number has only itself and one as even divisors.

If a parameter to GCD is >=2^53, GCD returns the #NUM! error value.

Related Video Tutorials

Formula examples using the GCD function



Related Course Modules



Download our comprehensive DAX Formula Reference Guide as perfect companion as you learn how to use DAX formulas within Power BI.

Download DAX Formulas Reference Guide
Download DAX Formula Reference Guide