A
C
- CALCULATE
- CALCULATETABLE
- CALENDAR
- CALENDARAUTO
- CEILING
- CHISQ.DIST
- CHISQ.DIST.RT
- CHISQ.INV
- CHISQ.INV.RT
- CLOSINGBALANCEMONTH
- CLOSINGBALANCEQUARTER
- CLOSINGBALANCEYEAR
- COALESCE
- COLUMNSTATISTICS
- COMBIN
- COMBINA
- COMBINEVALUES
- CONCATENATE
- CONCATENATEX
- CONFIDENCE.NORM
- CONFIDENCE.T
- CONTAINS
- CONTAINSROW
- CONTAINSSTRING
- CONTAINSSTRINGEXACT
- CONVERT
- COS
- COSH
- COT
- COTH
- COUNT
- COUNTA
- COUNTAX
- COUNTBLANK
- COUNTROWS
- COUNTX
- COUPDAYBS
- COUPDAYS
- COUPDAYSNC
- COUPNCD
- COUPNUM
- COUPPCD
- CROSSFILTER
- CROSSJOIN
- CUMIPMT
- CUMPRINC
- CURRENCY
- CURRENTGROUP
- CUSTOMDATA
D
E
I
N
O
P
R
S
- SAMEPERIODLASTYEAR
- SAMPLE
- SEARCH
- SECOND
- SELECTCOLUMNS
- SELECTEDMEASURE
- SELECTEDMEASUREFORMATSTRING
- SELECTEDMEASURENAME
- SELECTEDVALUE
- SIGN
- SIN
- SINH
- SLN
- SQRT
- SQRTPI
- STARTOFMONTH
- STARTOFQUARTER
- STARTOFYEAR
- STDEVX.P
- STDEVX.S
- STDEV.P
- STDEV.S
- SUBSTITUTE
- SUBSTITUTEWITHINDEX
- SUM
- SUMMARIZE
- SUMMARIZECOLUMNS
- SUMX
- SWITCH
- SYD
T
U
Syntax
The syntax for the LEFT function is as follows:
LEFT(text, num_chars)
Where `text` is the string you want to extract from, and `num_chars` is the number of characters you want to extract.
Examples
Example 1: Extracting the First Name from a Full Name
Let's say you have a column in your data set that contains the full names of your customers, and you want to extract their first names. You can use the LEFT function to do this. Here is an example of how to do it:
=LEFT([Full Name], FIND(” “, [Full Name])-1)
In this example, we are using the FIND function to locate the first space in the full name and subtracting one to get the number of characters to extract. This will give us the first name of each customer.
Example 2: Extracting the First Two Characters of a Code
Let's say you have a column in your data set that contains codes for different products, and you want to extract the first two characters of each code. You can use the LEFT function to do this. Here is an example of how to do it:
=LEFT([Product Code], 2)
In this example, we are simply extracting the first two characters of each product code.
The LEFT function in Power BI is a powerful tool that can be used in many different scenarios. Whether you need to extract a specific subset of data or simply want to clean up your data set, the LEFT function can help. By understanding the syntax and examples provided in this article, you should be able to use the LEFT function in your own Power BI projects.