LCM

Updated on

LCM is a DAX function that returns the least common multiple of two integers.

Syntax

LCM(
   Number1,
   Number2
)
Argument Properties Description
Number1 The first number, if value is not an integer, it is truncated.
Number2 The second number, if value is not an integer, it is truncated.

Return Values

Returns the least common multiple of integers.

Remarks

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

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

  • If LCM(a,b) >=2^53, LCM returns the #NUM! error value.

  • This function is not supported for use in DirectQuery mode when used in calculated columns or row-level security (RLS) rules.

Example

Formula Description Result
= LCM(5, 2) Least common multiple of 5 and 2. 10
= LCM(24, 36) Least common multiple of 24 and 36. 72

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/dax/lcm-function-dax

2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy