5 - Power BI - Query Editor - Number Transformation
5 - Power BI - Query Editor - Number Transformation
◦ Go to ➔ [Add Column]
tab → [From Number] →
[Standard] → [Percentage]
◦ In Value field select ‘Use
Values in a column’
◦ Then select ‘Rate Per Unit’
◦ Click ‘Ok’
YOU GET A NEW COLUMN NAMED ‘Percent Of’ WHICH IS REVISED RATE IN
PERCENT.
RENAME THIS COLUMN AS ‘Revised Rate %’
Number
Transformation:
‘Round’ Function
Rounding Function available on ‘Transform’ tab
as well as on ‘Add Column’ tab. They are:
◦ Round Up
◦ Round Down
◦ Round
Divide
‘Revised Rate’
by ‘Modulo’
◦ Select ‘Revised Rate’
column and by holding
CTRL key select ‘Modulo’
column in ‘Row
Transformation’ Query
Table.
◦ Go to ➔ [Add Column] →
[From Number] →
[Standard] → [Divide]
◦ You get and new column
named ‘Division’
Number
Transformation:
‘Round’ Function
Rounding Function available on ‘Transform’ tab
as well as on ‘Add Column’ tab. They are:
◦ Round Up
◦ Round Down
◦ Round
Transform Tab: ‘Round
Up’ Function
◦ Round numbers in the selected columns to the
next integer value.
Transform Tab: ‘Round
Down’ Function
◦ Round numbers in the selected columns to the
previous integer value.
Transform Tab: ‘Round…’
Function
◦ Round numbers in the selected columns to the
specified numbers of decimal digits.
Number
Transformation:
‘Information’ Function
◦ Information function looks at the cell or row
that is provided as an argument and tells you
whether the value matches the expected
type. They are:
◦ Is Even
◦ Is Odd
◦ Sign
Number Transformation:
‘Is Even’ Function
◦ Returns whether the numbers in the selected
columns are even.
◦ Try it on ‘Invoice’ column in ‘Row
Transformation’ Query table.
Number Transformation:
‘Is Odd’ Function
◦ Return whether the numbers in the selected
columns are odd.
◦ Try it on ‘Invoice’ column in ‘Row
Transformation’ Query table.
Add a New Column ‘Rate
Per Unit’ subtracted by
‘Revised Rate’
◦ Select Rate Per Unit column and then ‘Revised
Rate’ in ‘Row Transformation’ Query table.
◦ Go to ➔ [Add Column] →[From Number] →
[Standard] → [Subtract]
◦ You get a new column named ‘Subtraction’
Number Transformation:
‘Sign’ Function
◦ Returns the sign of numbers in the selected columns.
◦ Try it on ‘Subtraction’ column in ‘Row Transformation’
Query table.
◦ For positive numerical value, it shows the 1 sign and for
the numerical value. It shows -1
‘Scientific’ Number Transformation
‘Transform’ Tab ‘Add Column’ Tab
◦ Returns the absolute value of numbers in the ◦ Creates a new column which contains the
selected columns. absolute value of the number in the selected
column.
Scientific Number : Power → Square
‘Transform’ Tab ‘Add Column’ Tab
◦ Returns the square of numbers in the selected ◦ Create a new column which contains the square
columns. of numbers in the selected column.
Scientific Number : Power → Cube
‘Transform’ Tab ‘Add Column’ Tab
◦ Return the cube of the numbers in the selected ◦ Create a new column which contains the cube
columns. of numbers om the selected column.
Scientific Number : Power → Power…
‘Transform’ Tab ‘Add Column’ Tab
◦ Return the numbers in the selected columns ◦ Create a new column which contains the
raised to a specified power. numbers in the selected column raised to a
specified power.
◦ If two columns are selected, the column created
will contain the values in the first column raised
to the corresponding value in the second
column.
Scientific Number: Square Root
‘Transform’ Tab ‘Add Column’ Tab
◦ Returns the square root of numbers in the ◦ Create a new column which contains the
selected columns. square root of numbers in the selected column.
Scientific Number: Exponent
◦ An exponent refers to the number of times a ◦ When an exponent is a negative number, the
number is multiplied by itself. result is always a fraction. Fractions consist of a
For example, 2 to the 3rd (written like numerator over a denominator. In this instance,
this: 23) means: the numerator is always 1. To find the
2 x 2 x 2 = 8. denominator, pretend that the negative
exponent is positive, and raise the number to
◦ Remember that a number raised to the power of
that power, like this:
1 is itself. For example,
6-3 = 1 / 63
51 = 5.
◦ There are some special cases:
60 = 1
Scientific Number: Logarithm
Logarithm: Base-10 Natural Logarithms: Base ‘e’
◦ A logarithm answers the question: ◦ Another base that is often used is e (Euler's Number)
How many times one number do we multiply to get which is about 2.71828.
another number?
◦ This is called a "natural logarithm". Mathematicians use
◦ So Logarithm of 8 (answer) to the base-2 (multiplier this one a lot.
number as 2) is 3 (exponent or Logarithm value). So the
Logarithm of 8 to base 2 is 3. ◦ It is how many times we need to use "e" in a
In this example: 23 = 2 × 2 × 2 = 8 multiplication, to get our desired number.
◦ Similarly Logarithm Value of 1000 to the base-10 is 3. ◦ On a calculator it is the "ln" button.
103 = 10 × 10 × 10 = 1000 ◦ Example: ln(7.389) = loge(7.389) ≈ 2
◦ Exponents and Logarithms are related. The exponent says ◦ Because 2.718282 ≈ 7.389
how many times to use the number in a multiplication.
The logarithm tells us what the exponent is!
Scientific Number: Exponent
‘Transform’ Tab ‘Add Column’ Tab
◦ Return the exponent of numbers in the selected ◦ Create a new column which contains the
columns. exponent of numbers in the selected column.
Scientific Number: Logarithm →Base-10
‘Transform’ Tab ‘Add Column’ Tab
◦ Return the base-10 logarithm of numbers in the ◦ Create a new column which contains the base-
selected columns. 10 logarithm of numbers in the selected
column.
Scientific Number: Logarithm →Natural
‘Transform’ Tab ‘Add Column’ Tab
◦ Return the natural logarithm of numbers in the ◦ Create a new column which contains the natural
selected columns. logarithm of numbers in the selected column.
The factorial function (symbol: !) says
to multiply all whole numbers from our
chosen number down to 1.
Scientific Examples:
Number: 4! = 4 × 3 × 2 × 1 = 24
7! = 7 × 6 × 5 × 4 × 3 × 2 × 1 = 5040
1! = 1
Factorial
So the rule is:
n! = n × (n−1)!
Which says "the factorial of any number
is that number times the factorial of
(that number minus 1)"
Scientific Number: Factorial
‘Transform’ Tab ‘Add Column’ Tab
◦ Return the factorial of numbers in the selected ◦ Create a new column which contains the
columns. factorial of numbers in the selected column.
Trigonometric Number
Transformation
◦ Trigonometry is a branch of mathematics that
studies relationships between side lengths and
angles of triangles.
◦ Question: From the top of a lighthouse 55 ft
above sea level, the angle of depression to a small
boat is 11.3 degrees. How far from the foot of the
lighthouse is the boat?
◦ Answer: Foot of the light house from the boat
=275.25’
Trigonometric
◦ For this demonstration, we need to examine a
couple ways of describing “slant.”
◦ First is slope, which is a ratio that compares how
many units a line increases vertically (its rise)
compared to how many units it increases
horizontally (its run).
◦ Slope is therefore calculated as rise divided by run.
tan A = a/b
Sine, cosine and tangent
◦ Trigonometric ratios are the ratios between edges of a right triangle.
These ratios are given by the following trigonometric functions of the
known angle A, where a, b and c refer to the lengths of the sides in
the accompanying figure:
◦ Sine function (sin), defined as the ratio of the side opposite the angle
to the hypotenuse.
◦ Cosine function (cos), defined as the ratio of the adjacent leg (the
side of the triangle joining the angle to the right angle) to the
hypotenuse.
◦ Tangent function (tan), defined as the ratio of the opposite leg to the
adjacent leg.
Terms Used
◦ The hypotenuse is the side opposite to the 90 degree angle in a
right triangle; it is the longest side of the triangle and one of the
two sides adjacent to angle A.
◦ The adjacent leg is the other side that is adjacent to angle A.
◦ The opposite side is the side that is opposite to angle A.
◦ The terms perpendicular and base are sometimes used for the
opposite and adjacent sides respectively.
Cosecant, Secant and
Cotangent
◦ Since any two right triangles with the same acute angle A are similar,
the value of a trigonometric ratio depends only on the angle A.
◦ The reciprocals of these functions are named the cosecant (csc),
secant (sec), and cotangent (cot), respectively:
◦ The cosine, cotangent, and cosecant are so named because they are
respectively the sine, tangent, and secant of the complementary angle
abbreviated to "co-".
Trigonometric
Functions
◦ With these functions, one can answer virtually all questions about
arbitrary triangles by using the law of sines and the law of cosines.
These laws can be used to compute the remaining angles and sides of
any triangle as soon as two sides and their included angle or two
angles and a side or three sides are known.
The unit circle and common
trigonometric values
◦ Trigonometric ratios can also be represented using the unit circle,
which is the circle of radius 1 centered at the origin in the plane.
◦ In this setting, the terminal side of an angle A placed in standard
position will intersect the unit circle in a point (x,y), where x = cos
A and y = sin A.
◦ The names of the inverse trigonometric functions,
Inverse Trigonometric together with their domains and range, can be
Trigonometric
triangulation is used in astronomy to measure the distance to nearby stars, as well as in satellite
navigation systems.
Navigation
Functions ◦ Historically, trigonometry has been used for locating latitudes and longitudes of sailing vessels, plotting
courses, and calculating distances during navigation. Trigonometry is still used in navigation through
such means as the Global Positioning System and artificial intelligence for autonomous vehicles.
Surveying
◦ In land surveying, trigonometry is used in the calculation of lengths, areas, and relative angles between
objects. On a larger scale, trigonometry is used in geography to measure distances between landmarks.
Periodic functions
◦ The sine and cosine functions are fundamental to the theory of periodic functions, such as those that
describe sound and light waves. Fourier discovered that every continuous, periodic function could be
described as an infinite sum of trigonometric functions. Even non-periodic functions can be
represented as an integral of sines and cosines through the Fourier transform. This has applications to
quantum mechanics and communications, among other fields.
Optics and Acoustics
◦ Trigonometry is useful in many physical sciences, including acoustics, and optics. In these areas, they
are used to describe sound and light waves, and to solve boundary- and transmission-related problems.