# Number.IntegerDivide

## Understanding the Number.IntegerDivide Function

Before we dive into the M code behind the Number.IntegerDivide function, it’s important to understand how this function works. The function takes two arguments: numerator and denominator. It then divides the numerator by the denominator and returns the integer portion of the result. For example, if the numerator is 10 and denominator is 3, Number.IntegerDivide will return 3.

Here is the syntax of the Number.IntegerDivide function:

Number.IntegerDivide(numerator, denominator)

``` The M Code Behind Number.IntegerDivide The M code behind the Number.IntegerDivide function is relatively simple. The M code for this function is as follows: ```

let

result = numerator div denominator

in

result

``` As you can see, the code is quite straightforward. The "let" statement defines a variable called "result" and sets its value to the result of dividing the numerator by the denominator using the "div" operator. The "div" operator is a built-in M function that performs integer division. Finally, the "in" statement returns the value of the "result" variable. Using Number.IntegerDivide in Power Query Now that you understand the M code behind the Number.IntegerDivide function, let's see how you can use this function in Power Query. To use Number.IntegerDivide, simply open the Power Query Editor and create a new column. Then, enter the following code in the formula bar: ```

Number.IntegerDivide([numerator], [denominator])

``` Replace "numerator" and "denominator" with the column names or values you want to use. When you press Enter, Power Query will create a new column with the integer portion of the division result. The Number.IntegerDivide function is a simple yet powerful tool for performing integer division in Power Query. The M code behind this function is straightforward and easy to understand. By using Number.IntegerDivide, you can perform division operations in Power Query and return only whole numbers. We hope this article has helped you better understand the M code behind the Number.IntegerDivide function in Power Query. Power Query and M Training Courses by G Com Solutions (0800 998 9248) Power Query and M Intensive Training Course £1,050.00 – £26,550.00 Select optionsContinue Loading Done Power Query and M Introduction £395.00 – £9,750.00 Select optionsContinue Loading Done Power Query and M Intermediate £395.00 – £9,750.00 Select optionsContinue Loading Done Power Query and M Advanced £395.00 – £9,750.00 Select optionsContinue Loading Done Upcoming Courses Contact Us Subject Your Name (required) Company/Organisation Email (required) Telephone Training Course(s) Power BI Intensive TrainingPower BI introduction Power BI IntermediatePower BI AdvancedDAXPower Query MPower BI CertificationPower BI AdministrationPower PlatformPower AutomatePower AppsOTHER Your Message Upload Example Document(s) (Zip multiple files) ```
``` ```
``` ```
``` ```
``` ```
``` ```