Returns the specified number of characters from the start of a text string. It come under Text function Dax category.
Syntax:
LEFT(<Text> , <NumberOfCharacters> )
Description:
SNo. | Parameter | Description |
1 | Text | The text string containing the characters you want to extract. |
2 | NumberOfCharacters | This is Optional, The number of characters you want LEFT to extract. If omitted, default is 1. |
Let’s start with an example:
Step-1: Sample Dataset as below:
Step-2: Create a new column, right-click on the dataset and select “New column.”
Step-3: Now, let’s write the LEFT DAX function with one parameter. This function returns the first character from the left side of the text.
Left_Default = LEFT(Orders[Product Sub-Category])
Step-4: Add an additional column and utilize the LEFT DAX function with two parameters. This function extracts the first five characters from the left side of the given data.
Left_With_Position = LEFT(Orders[Product Sub-Category],5)
Step-5: Drag both of the new columns onto the Table visual and observe the resulting output.
Hope you enjoyed the post. Your valuable feedback, question, or comments about this post are always welcome or you can leave us message on our contact form , we will revert to you asap.
Recommended DAX Post: