Hi All,
In this blog-post, we would understand the group “From Number” in Microsoft Power Query. In our previous blog-post, we had discussed the split number and Text function in Microsoft Power Query.
One question which is most likely asked by the people that when we can do the calculation in Ms-Excel, then why we need to learn Microsoft Power Query? and the reasons are listed below-
- 1-Because Microsoft Power Query can upload heavy data without any interruption.
- 2- No additional calculative formulas are required to do the calculation.
- 3- The best place to extract and combine the “text values”. Find and remove the duplicates values in easy steps.
- 4- it can merge the multiple files at once. it can append the different types of file format too.
There are so many reasons to learn Microsoft Power Query. We have already understood some of the reason in our previous blog-post and Today we will cover the Form Number in Microsoft Power Query. Let’s take an example and understand.
We have a sales database above in the screenshot.
How to convert the database into the table format-
- Select the database
- Go to Insert Tab->> Table or Press Short cut key Ctrl+T
- Make sure click on “My table has a header”
- Ok
Once the database converts into a table format, Now let’s upload the database into Power Query.
How to upload Table into the power query?
- Go to Data Tab
- Into the group of “Get & Transform Data”
- Click on Table\Range option
- After click on Table/Range, the database will be open in a new dialogue box. This window is called “Microsoft Power Query” and the page where it will perform the task is called “Microsoft Power Query Editor”.
- Microsoft Power Query Editor
- Ribbon Tab
- M-Code (Natural programming language)
- Table database
- Microsoft Power query settings
- Applied Steps
In the above screenshot, the date column is showing date with time format, however, we want only date format. So, Let’s change it-
How to do the correct Date Format?
- Select the Date Column
- Home Tab
- In the group of “Transform”
- Click on Date Type
- Choose Date
Or
Click on the date icon located at the left edge of the Date Column and choose Date option.
When we choose the date format, we get a dialogue box. Which ask us, whether we want to see the impact on the existing column or place the data on the new column. Refer the screenshot below-
For this example, we will choose to replace current data. Let’s click on the option “Replace current” and see the impact on below mention screenshot-
By the way, we came here to discuss the Number columns. Therefore, we will select the sales amount. When we click on the ribbon tab and find out the From Number group. Form Number, group option is showing into two tabs. Transform & Add column. Let’s understand the difference between the first-
- Transform- when we do any calculation and wanted to see its impact on the existing column. We will use option Transform
- Add column— when we do any calculation and wanted the result in a new column. We will use the option Add Column
The number is divided into 6 parts. Let’s discuss each one by one—
From Number
Statistics-
Before applying any condition, make sure, we have selected the columns which are consisting of numerical values otherwise theses option will be hidden.
When we click on the statistics option. The following list appears related to statistical tools-
- Sum– it will show the total sales amount. follow the steps- Select the sales amount>>Go to transform>> Click on statistics>> choose Sum
And this will be the answer-
Similarly, if we choose Maximum, Minimum, average, median and standard Deviation option we will get the result according to their selection. However, in the last 2 option “Count Values” and “Count Distinct values”, by the way, their sounds look the same, but the reality is different. come and Let’s understand it one by one–
- Count Values– This option helps us to count the entry entered the selected column, no matter if it has duplicates values. It counts everyone. For example, if we select the column “Sales Rep” and apply the option >> Transform>>Statistics>>Count Values. Answer is 15
2. Count Distinct Values- when we want to count only unique values use Distinct count. For example, if we select the sales rep. and apply Transform>>Statistics>>distinct count. The answer will be 10 because it refuses to count duplicate values-
As we can see into the above screenshot when we click on the option “Standard”. The following list will appear –
- Add– when we choose the option “Add”. A new window appears which ask to enter a number to add each value in the column. For Example, if we want to add 1000 in each value. Follow the below mention procedure-
Select the sales amount>>standard>>add>>1000>>Ok
As we did and explained, how we Add numerical value into the above screenshot. Similarly, we can do the different calculation without any further formula. Other options are listed below-
- Multiply- Enter a number by which multiply each value in the columns
- Subtract- Enter a number to subtract from each value in the columns
- Divide- Enter a number by which divide each value into the columns
- Integer-Divide- Enter a number by which integer-Divide each value in the columns
- Modulo- Enter a number from which to find a reminder to each value in the columns
- Percentage- Enter a percentage to apply to each value in the columns
- Percent Of- Enter a value to find each value in the selected columns as a percentage of it
Apart from adding and subtraction, but, also we can do the scientific calculation into the power query. When we click on the option “scientific”. The following option will appear-
- Absolute value– when we want to change all negative value into the positive number
- Power– when we want to calculate the square or cube of the number column
- Square root– when we want to get the square root of numerical values.
Similarly, we can use the option exponent, logarithm and factorial. Just select the column (Sales amount)>> click on scientific >> and choose the option
If we want to do trigonometry calculation, following trigonometry formula, we can use these function to do the calculation –
- Sine
- Cosine
- Tangent
- Arcsine
- Arccosine
- Arctangent
Select the column>> Trigonometry>>choose the option >> ok
Rounding-
The round function rounds a number to a specified number of digits. If Cell B1 contains 23,45789 and we want to round that value in two decimal places. We can use this formula-
- Round-
- Select the column
- Rounding
- Round
- Specify how many decimal places to round to
- If we type 2. it will convert into 2 decimal places
- If we type 1. It will convert into 1 decimal place
- If we type 0. It will convert the value into the round figure
2. Round-Up- it always rounds a number up.
3. Round down- it always rounds a number down.
Information-
As its name information, it gives us the information about the numerical values. When we click on the information following list will be display-
- Is Even- It gives us TRUE if the value is even number or it gives us FALSE value
- Is ODD- It gives us TRUE values if it is finding an odd number and for others, it gives FALSE
- Sign- For positive numerical value, it shows the 1 sign and for the numerical value. It shows -1
Hope, this blog-post helps you to understand the group “From Number” into the Power Query. Do apply on your sheet and let us know if you have any queries. Do write your queries and question into the comment box. We will be happy to assist you.
Stay tuned with Nurture Tech Academy.
Happy Learning 😊