# Number.Sin

## #

The Number.Sin function is used to calculate the sine of a given angle in radians. It takes an argument, which is the angle in radians, and returns the sine value. The sine function is a mathematical function that is used to calculate the ratio of the length of the opposite side to the length of the hypotenuse of a right-angled triangle.

## Understanding the M Code Behind the Number.Sin Function

The M code behind the Number.Sin function is quite simple. It uses the built-in Math function in M to calculate the sine of the given angle. Here is the M code for the Number.Sin function:

let

Number.Sin = (angle) =>

Math.Sin(angle)

in

Number.Sin

``` In the above code, the 'let' keyword is used to define a new function called Number.Sin. The function takes a single argument, angle, which represents the angle in radians. The '=>' symbol is used to define the body of the function, which is the Math.Sin function. The 'in' keyword is used to specify the output of the function, which is Number.Sin. Using the Number.Sin Function in Power Query Now that we know the M code behind the Number.Sin function, let's see how we can use it in a Power Query transformation. Suppose we have a table with a column that contains angles in radians. We want to calculate the sine of each angle and add it as a new column. Here's how we can do that using the Number.Sin function: 1. Load the table into Power Query. 2. Select the column that contains the angles in radians. 3. Go to the 'Add Column' tab and click on 'Custom Column'. 4. In the 'Custom Column' dialog box, enter the following formula: ```

Number.Sin([Angle])

``` This will apply the Number.Sin function to each value in the 'Angle' column and return the result. 5. Click on 'OK' to create the new column. The above steps will create a new column that contains the sine of each angle in radians. Advantages of Using the Number.Sin Function in Power Query The Number.Sin function is a very useful function in Power Query. Here are some advantages of using the Number.Sin function: 1. Simplifies Data Transformations: The Number.Sin function simplifies the process of calculating the sine of angles in Power Query. This function can save a lot of time and effort when dealing with large datasets. 2. Accuracy: The Number.Sin function is a highly accurate function that provides precise results. It is based on the Math.Sin function, which is a well-established mathematical function. 3. Flexibility: The Number.Sin function is a flexible function that can be used in a variety of scenarios. It can be used to calculate the sine of angles in different units such as degrees, radians, or gradians. The Number.Sin function is a powerful function in Power Query that simplifies the process of calculating the sine of angles. It is based on the Math.Sin function, a well-established mathematical function that provides highly accurate results. The Number.Sin function is flexible and can be used in a variety of scenarios. It is a valuable tool for data analysts and data scientists who work with large datasets. 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) ```
``` ```
``` ```
``` ```
``` ```
``` ```