Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
CetinT
Frequent Visitor

Using LEN in LEFT

Hi Everbody,


I want to count the characters in a column, subtract a certain number of characters from this number and then shorten it.
But it gives an error. Below is the DAX code I use. Is it possible for you to help?

LEFT(SALES[W_HOUSE]; LEN(SALES[W_HOUSE])-2)

 

1 ACCEPTED SOLUTION

Hi, @CetinT 

@CetinT 

create new calculated column

Column = LEFT('Table'[W_HOUSE],LEN('Table'[W_HOUSE])-2)

Dangar332_0-1698915486398.png

 

or YOU can create measure 

Measure = MAXX('Table',LEFT('Table'[W_HOUSE],LEN('Table'[W_HOUSE])-2))
Dangar332_1-1698915773216.png

 

 

View solution in original post

5 REPLIES 5
Dangar332
Resident Rockstar
Resident Rockstar

HI, @CetinT 

LEFT(SALES[W_HOUSE], LEN(SALES[W_HOUSE])-2)

use ( , )  instead of  ( ; )

Thanks for your suggestion. But due to the regional settings of my computer I have to use ( ; ).

Hi, @CetinT 

provide some sample data

 

You can find sample data below. I want to cut the last two characters.

 

W_HOUSERESULT
DOR00401DOR004
TIRDOR00501TIRDOR005
FDOR00601FDOR006

Hi, @CetinT 

@CetinT 

create new calculated column

Column = LEFT('Table'[W_HOUSE],LEN('Table'[W_HOUSE])-2)

Dangar332_0-1698915486398.png

 

or YOU can create measure 

Measure = MAXX('Table',LEFT('Table'[W_HOUSE],LEN('Table'[W_HOUSE])-2))
Dangar332_1-1698915773216.png

 

 

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.