GCD
A
C
- CALCULATE
- CALCULATETABLE
- CALENDAR
- CALENDARAUTO
- CEILING
- CHISQ.DIST
- CHISQ.DIST.RT
- CHISQ.INV
- CHISQ.INV.RT
- CLOSINGBALANCEMONTH
- CLOSINGBALANCEQUARTER
- CLOSINGBALANCEYEAR
- COALESCE
- COLUMNSTATISTICS
- COMBIN
- COMBINA
- COMBINEVALUES
- CONCATENATE
- CONCATENATEX
- CONFIDENCE.NORM
- CONFIDENCE.T
- CONTAINS
- CONTAINSROW
- CONTAINSSTRING
- CONTAINSSTRINGEXACT
- CONVERT
- COS
- COSH
- COT
- COTH
- COUNT
- COUNTA
- COUNTAX
- COUNTBLANK
- COUNTROWS
- COUNTX
- COUPDAYBS
- COUPDAYS
- COUPDAYSNC
- COUPNCD
- COUPNUM
- COUPPCD
- CROSSFILTER
- CROSSJOIN
- CUMIPMT
- CUMPRINC
- CURRENCY
- CURRENTGROUP
- CUSTOMDATA
D
E
I
N
O
P
R
S
- SAMEPERIODLASTYEAR
- SAMPLE
- SEARCH
- SECOND
- SELECTCOLUMNS
- SELECTEDMEASURE
- SELECTEDMEASUREFORMATSTRING
- SELECTEDMEASURENAME
- SELECTEDVALUE
- SIGN
- SIN
- SINH
- SLN
- SQRT
- SQRTPI
- STARTOFMONTH
- STARTOFQUARTER
- STARTOFYEAR
- STDEVX.P
- STDEVX.S
- STDEV.P
- STDEV.S
- SUBSTITUTE
- SUBSTITUTEWITHINDEX
- SUM
- SUMMARIZE
- SUMMARIZECOLUMNS
- SUMX
- SWITCH
- SYD
T
U
Syntax of the GCD Function
The syntax of the GCD function is as follows:
GCD(number1, [number2], …)
The GCD function takes one or more numbers as arguments and returns the greatest common divisor of those numbers. The arguments can be numbers, cell references, or expressions that evaluate to numbers. The GCD function ignores any non-numeric values in the arguments.
Using the GCD Function in Power BI
To use the GCD function in Power BI, follow these steps:
1. Create a new measure in the Power BI desktop.
2. In the formula bar, enter the GCD function syntax with the desired arguments. For example, to find the GCD of two numbers, enter:
GCD([Number1],[Number2])
3. Replace [Number1] and [Number2] with the appropriate column or measure names that contain the numbers you want to find the GCD of.
4. Name the measure something descriptive, such as "GCD of Numbers".
5. Press Enter to create the measure.
Examples of Using the GCD Function
Let's look at some examples of how to use the GCD function in Power BI.
Example 1: Finding the GCD of Two Numbers
Suppose you have a table that contains two columns, Number1 and Number2, and you want to find the GCD of these numbers. Here's how you can do it:
1. Create a new measure in the Power BI desktop.
2. In the formula bar, enter the GCD function syntax with the appropriate arguments. For example, if Number1 is in the column "Column1" and Number2 is in the column "Column2", enter:
GCD([Column1],[Column2])
3. Name the measure something descriptive, such as "GCD of Numbers".
4. Press Enter to create the measure.
The measure will now calculate the GCD of the numbers in the specified columns.
Example 2: Finding the Lowest Common Multiple of Two Numbers
Suppose you have a table that contains two columns, Number1 and Number2, and you want to find the lowest common multiple of these numbers. Here's how you can do it using the GCD function:
1. Create a new measure in the Power BI desktop.
2. In the formula bar, enter the following formula:
(Number1*Number2)/GCD(Number1,Number2)
3. Replace "Number1" and "Number2" with the appropriate column or measure names that contain the numbers you want to find the GCD of.
4. Name the measure something descriptive, such as "LCM of Numbers".
5. Press Enter to create the measure.
The measure will now calculate the lowest common multiple of the numbers in the specified columns.
Example 3: Simplifying Fractions
Suppose you have a table that contains two columns, Numerator and Denominator, and you want to simplify the fractions represented by these numbers. Here's how you can do it using the GCD function:
1. Create a new measure in the Power BI desktop.
2. In the formula bar, enter the following formula:
DIVIDE(Numerator,GCD(Numerator,Denominator))&”/”&DIVIDE(Denominator,GCD(Numerator,Denominator))
3. Replace "Numerator" and "Denominator" with the appropriate column or measure names that contain the numbers you want to find the GCD of.
4. Name the measure something descriptive, such as "Simplified Fraction".
5. Press Enter to create the measure.
The measure will now simplify the fractions in the specified columns.
The GCD function in Power BI is a powerful tool that allows you to find the greatest common divisor of two or more numbers. With this function, you can find the lowest common multiple of two or more numbers, simplify fractions, and perform other useful calculations. By following the steps outlined in this article, you can start using the GCD function in your Power BI reports and gain deeper insights into your data.