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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
nkasdali
Microsoft Employee
Microsoft Employee

Substring in Power BI ?!

Hi All,

 

I'm coming from Qlikview world, so i'm looking the equivalent of SUBSTRING function.

 

So, this function will return a string in a specific position, exemple

 

Value : TD_AA_BB

 

i wan to have what after the second "_". Then in Qlikview the function will be  Substring("TD_AA_BB","_",2)

 

Do you how can i do to get the same in Power Bi ?

 

 

Thanks

1 ACCEPTED SOLUTION
gbarrachina
Regular Visitor

You need to use the function

MID(Txt, StartPosition, NumberOfCharacters)

View solution in original post

4 REPLIES 4
gbarrachina
Regular Visitor

You need to use the function

MID(Txt, StartPosition, NumberOfCharacters)

Thanks, it works well.

 

But, do you know how can i do to not have the (Blank) value ?

 

This is my expression :

 

APP_Cible = if(left(v_hist_usage_sid[UserName];6)="US_BDF";mid(v_hist_usage_sid[UserName];8;3))

 

Capture.PNGthanks

Anonymous
Not applicable

@nkasdali,

You can choose one of the following options to exclude the blank.


1. Drag the APP-Cible column to page level filters, then set its value as "Not blank".
1.JPG

2. Create a new column using DAX below.

newcolumn = IF(ISBLANK(v_hist_usage_sid[APP_Cible]);"enter your expected value";v_hist_usage_sid[APP_Cible])

2.JPG

Regards,
Lydia

"In Power BI" can mean either DAX (see previous post) or Power Query.

 

A Power Query solution would be to use the option Text After Delimiter under "Extract" in the "Transform" or "Add Column" menu.

 

Screenshot, including the generated formula that will give you the part after the second "_":

 

Text after delimiter.png

Specializing in Power Query Formula Language (M)

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

FabCon and SQLCon Highlights Carousel

FabCon & SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

Users online (7,417)