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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
Super User
Super User

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors