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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
juhoneyighot
Helper III
Helper III

Get the Characters from a text using DAX

Hello!

I need help to get the characters from a certain text using DAX. I have this Column "JobType". See table below.

JobtypeNC.INPhaseStatus
NC 120_Rough Builder Walk__10Not StartedNCNC 120_Rough Builder Walk10Not Started
NC.IN 720_Dehu_Estimate__90CompleteNC.INNC.IN 720_Dehu_Estimate90Complete
IN 622_CO EQ_QC__90CompleteININ 622_CO EQ_QC90Complete
Install_Estimates   

 I have to use a DAX to get the characters for the Phase and Status Column from Jobtype column with this condition. If Column NC.IN is "" then ""

 

else 

 

Phase column is extracted before the __(2underscores)

Status column is extracted after the __(2underscores)

 

I am confused what correct DAX formula to use. 

 

Thank you.

1 ACCEPTED SOLUTION

you need creat a measure

Screenshot_1.png

View solution in original post

8 REPLIES 8
Ahmedx
Super User
Super User

pls try this

Status = IF(
    NOT ISBLANK( 'Table'[NC.IN] ),
    PATHITEM( SUBSTITUTE( 'Table'[Jobtype], "__", "|" ), 2 ),
    ""
)

Screenshot_2.png

you need creat a measure

Screenshot_1.png

@Ahmedx The solution works for Status Column.

 

Can I also ask help for the Phase Column. Same condition with Status column but Phase Column is extracted before the 2_(two Underscores).

 

Thank you.

this is ok now.. I use the PATHITEMREVERSE Dax.

 

Thank you.

@Ahmedx 

I tried it but the error is this.

juhoneyighot_0-1700492272911.png

 

DOLEARY85
Resident Rockstar
Resident Rockstar

Hi,

 

try these in custom columns:

 

Phase= If ([NC.IN] = "", "", left([Jobtype], search("__",[Jobtype],,0)))
 
Status= If ([NC.IN] = "", "", right([Jobtype], len([Jobtype]) - search("__",[Jobtype],,0)))
 
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Hi @DOLEARY85 

if i added the Calculated Phase column the error is this.

juhoneyighot_1-1700492734825.png

When I click see details 

juhoneyighot_2-1700492770852.png

 

I assume you're using direct query mode which is going to make it difficult with DAX in calculated columns as what you can do is limited, you could try it as a measure but you have to be a little creative:

 

Phase = If (CALCULATE(max([NC.IN])) = "", "", left(CALCULATE(max([Jobtype])), search("__",CALCULATE(max([Jobtype])),,0)))
 
 
If this doesn't work you might be better creating a view in the source with the additional fields and then connecting that view to Power BI.
 
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.

Top Solution Authors