LEFT DAX Function (Text)
Returns the specified number of characters from the start of a text string.
Syntax
Parameter | Attributes | Description |
---|---|---|
Text |
The text string containing the characters you want to extract. |
|
NumberOfCharacters | Optional |
The number of characters you want LEFT to extract; if omitted, 1. |
Return values
A text string.
» 2 related functions
Examples
-- LEFT, RIGHT, MID and LEN are the basic string-manipulation functions DEFINE VAR Val = "DAX is so cool!" EVALUATE { ( "LEFT ( Val, 3 ) ", LEFT ( Val, 3 ) ), ( "RIGHT ( Val, 5 )", RIGHT ( Val, 5 ) ), ( "MID ( Val, 11, 4 )", MID ( Val, 11, 4 ) ), ( "LEN ( Val )", LEN ( Val ) ) }
Value1 | Value2 |
---|---|
LEFT ( Val, 3 ) | DAX |
RIGHT ( Val, 5 ) | cool! |
MID ( Val, 11, 4 ) | cool |
LEN ( Val ) | 15 |
Related articles
Learn more about LEFT in the following articles:
-
From SQL to DAX: String Comparison
In DAX string comparison requires you more attention than in SQL, for several reasons: DAX doesn’t offer the same set of features you have in SQL, a few text comparison functions in DAX are only case-sensitive and others only case-insensitive,… » Read more
-
Using join functions in DAX
This article describes the practical uses of NATURALLEFTOUTERJOIN and NATURALINNERJOIN in DAX. These functions are not commonly used in DAX because they do not have the same flexibility as the corresponding concepts in SQL. » Read more
-
Finding products without sales by using DAX
This article analyzes the performance of different DAX techniques to identify any products without sales in an area or a time period. » Read more
-
Managing hierarchical organizations in Power BI security roles
This article describes how to apply dynamic security roles in a hierarchical organization to minimize the maintenance effort on the security configuration and obtain the best performance at query time. » Read more
Related functions
Other related functions are:
Last update: Oct 3, 2024 » Contribute » Show contributors
Contributors: Alberto Ferrari, Marco Russo
Microsoft documentation: https://docs.microsoft.com/en-us/dax/left-function-dax