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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
admin11
Memorable Member
Memorable Member

How to return first letter from brand field ?

Hi All

I have a field name = Brand

The value label as below :-

Brand

IBM PC

APPLE 

APPLE NOTE BOOK

 

I expected result as below :-

Brand_New

IBM

APPLE

APPLE

 

Can some one share with me how to do it ? 

I prefer not to do at power quary.

 

Paul

1 ACCEPTED SOLUTION
tamerj1
Community Champion
Community Champion

Hi @admin11 
Two methods of doing that https://www.dropbox.com/t/gIx9yLZ98UgzPPbc

1.png

 

New Brand = 
VAR CurrentBrand = Data[Brand]
VAR Length = LEN ( CurrentBrand )
VAR T1 = GENERATESERIES ( 1, Length, 1 )
VAR T2 = ADDCOLUMNS ( T1, "@Letter1", IFERROR ( MID ( CurrentBrand, [Value], 1 ), BLANK ( ) ) )
VAR T3 = ADDCOLUMNS ( T2, "@Letter2", IF ( [@Letter1] = " ", "|", [@Letter1] ) )
VAR NewBrand = CONCATENATEX ( T3, [@Letter2] )
RETURN
    PATHITEM ( NewBrand, 1 )

2.png

New Brand 2 = 
VAR CurrentBrand = Data[Brand]
VAR NewBrand = REPLACE ( CurrentBrand, FIND ( " ", CurrentBrand, 1, 100 ), 1, "|" )
RETURN
    PATHITEM ( NewBrand, 1 )

 

View solution in original post

2 REPLIES 2
tamerj1
Community Champion
Community Champion

Hi @admin11 
Two methods of doing that https://www.dropbox.com/t/gIx9yLZ98UgzPPbc

1.png

 

New Brand = 
VAR CurrentBrand = Data[Brand]
VAR Length = LEN ( CurrentBrand )
VAR T1 = GENERATESERIES ( 1, Length, 1 )
VAR T2 = ADDCOLUMNS ( T1, "@Letter1", IFERROR ( MID ( CurrentBrand, [Value], 1 ), BLANK ( ) ) )
VAR T3 = ADDCOLUMNS ( T2, "@Letter2", IF ( [@Letter1] = " ", "|", [@Letter1] ) )
VAR NewBrand = CONCATENATEX ( T3, [@Letter2] )
RETURN
    PATHITEM ( NewBrand, 1 )

2.png

New Brand 2 = 
VAR CurrentBrand = Data[Brand]
VAR NewBrand = REPLACE ( CurrentBrand, FIND ( " ", CurrentBrand, 1, 100 ), 1, "|" )
RETURN
    PATHITEM ( NewBrand, 1 )

 

@tamerj1 

Thank you very much , it work. 

So now i understand why people refer to use power quary.

 

Paul

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.