OpenBI Docs Buy

LCM

The smallest whole number that both of two whole numbers go into, such as the day two delivery cycles meet.

Group: Math. Compatible with DAX.

Syntax

LCM ( <number1>, <number2> )
ParameterTypeDescription
number1Whole numberA whole number of 0 or more.
number2Whole numberA second whole number of 0 or more.

Returns

Whole number. The smallest positive whole number that is a multiple of both; 0 when either is 0.

Remarks

  • It takes exactly two numbers. For more, nest the calls: LCM ( LCM ( 2, 3 ), 4 ) is 12.
  • Decimals are rounded to whole numbers first, a half away from zero. A negative number is an error.
  • With a 0, or a blank, the result is 0.
  • It tells when two cycles meet again: deliveries every 4 days and every 6 days fall on the same day every 12 days.

Examples

Common multiples

EVALUATE
ROW (
    "4 and 6", LCM ( 4, 6 ),
    "2, 3 and 4", LCM ( LCM ( 2, 3 ), 4 ),
    "7 and 3", LCM ( 7, 3 ),
    "0 and 5", LCM ( 0, 5 )
)
4 and 62, 3 and 47 and 30 and 5
1212210

GCD, MOD.

Last updated · OpenBI Studio 0.3.74