cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
hozefamk
Frequent Visitor

Searching for first two letters in DAX

Problem statement:
If First 2 letter of ICODE = 51 then Computers else  If First 2 letter of ICODE = 11 then Raw MaterialsCapture.PNG
1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft
Microsoft

Re: Searching for first two letters in DAX

Hi @hozefamk

 

You could try something along these lines

 

Column = 
    SWITCH(
           TRUE() ,
           MID('Table'[ICODE],1,2) = "51" , 'Table'[Computers] ,
           MID('Table'[ICODE],1,2) = "11" , 'Table'[Raw Materials] ,
           BLANK()
          )

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

1 REPLY 1
Microsoft
Microsoft

Re: Searching for first two letters in DAX

Hi @hozefamk

 

You could try something along these lines

 

Column = 
    SWITCH(
           TRUE() ,
           MID('Table'[ICODE],1,2) = "51" , 'Table'[Computers] ,
           MID('Table'[ICODE],1,2) = "11" , 'Table'[Raw Materials] ,
           BLANK()
          )

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

Helpful resources

Announcements
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

April 2020 Community Highlights

April 2020 Community Highlights

Info on our Super Users, MBAS content and badges, and updates to our support articles. - Read the full Community Highlights.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

Top Solution Authors
Top Kudoed Authors