Day 18
Day 18
DAX functions – 3
D. Mathematical functions:
1. Floor
Example: New Sales = floor(Sales[ProductCost], 0.1) //Sales is table name and ProductCost is column
name
2. Pi
Syntax: pi()
3. Mod
4. Power
5. Fact
Returns the factorial of a number, equal to 1*2*3*...* Number.
Syntax: fact(number)
Example: Factorial value of Cost = fact(Sales[ProductCost])
For the complete list of Math functions available in Power BI, refer the following article:
Math and Trig functions - DAX Guide
E. Text functions:
Some common ones are listed below, along with their syntax and examples.
1. Lower
Converts all the letters in a text string to lowercase
Syntax: lower(text)
Example: Product Name = lower(“TOYS”) //output will be toys
2. Upper
Converts all the letters in a text string to uppercase
Syntax: upper(text)
Example: Product Name = upper(“toys”) //output will be TOYS
3. Format
Converts a value to text based on some specific format
Syntax:
Format(value, format string)
Example: New Currency Value = format(300.59, “Currency”)
Output: $300.59 //US dollar is the default currency mode in Power BI
4. Left
Returns the specified number of characters from the start of a text string.
Syntax: left(text, no_of_characters)
Example: Region Name = Left(“European”, 3)
Output: Eur
5. Right
Returns the last character or characters in a text string, based on the number of characters
you specify.
For the entire list of text functions in Power BI, refer the below link:
Text functions (DAX) - DAX | Microsoft Learn
Text functions - DAX Guide
***