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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply

undefined

@rubayatyasmin 

IMG_20230728_130806.jpg

 i need output as text without the bracket  ex : Head Office 

 I used to write the code 

Right ( dim( customer) , search("(" , dim( customer) 1, len ( dim( customer )+1)-1)

 My output is (Head Office)

 I need without bracket in dax query 

 

 

 

20 REPLIES 20
tamerj1
Super User
Super User

Hi @Karthikgayathri 
Please try

Bill to Customer 2 =
SUBSTITUTE ( SUBSTITUTE ( dimCustomer[Bill to Customer], ")", "" ), "(", "" )

 

IMG_20230728_144003.jpg

 for your query above image 

output . I need only head office without bracket 

@Karthikgayathri 
Sorry. I misunderstood the requirement. Please try 

Bill to Customer 2 = 
VAR String = dimCustomer[Bill to Customer]
VAR Items = SUBSTITUTE ( SUBSTITUTE ( String, "(", "|" ), ")", "|" )
RETURN
    PATHITEM ( Items, 2 )

IMG_20230728_150559.jpg

IMG_20230728_150507.jpg

  In 2 nd image - see the input 

       1 st image I got the same output but instead of N/A showing blank .in output both N/A and head office need to display. 

 

@tamerj1  plz reply 

@Karthikgayathri 

Bill to Customer 2 =
VAR String = dimCustomer[Bill to Customer]
VAR Items =
    SUBSTITUTE ( SUBSTITUTE ( String, "(", "|" ), ")", "|" )
RETURN
    COALESCE ( PATHITEM ( Items, 2 ), "N/A" )

Still N/A not displayed

@Karthikgayathri 

Try

Bill to Customer 2 = 
VAR String = dimCustomer[Bill to Customer]
VAR Items = SUBSTITUTE ( SUBSTITUTE ( String, "(", "|" ), ")", "|" )
VAR Result = PATHITEM ( Items, 2 )
RETURN
    IF ( Result = BLANK ( ), "N/A", Result )

Kaagaz_20230728_212620832675-1 (1).jpg

IMG_20230728_212316.jpg

  ok I will try your code . Above image see my code and my output. in output head office showing but in N/A only showing A alone wht is the issue in my code plz tell .

@Karthikgayathri 

This is not my code. 

@rubayatyasmin 

@I have one doubt in Power bi service. In dashboard tile refresh failed.wht are the steps u follow ( one intervention questio

@Karthikgayathri check refresh failure message. Then troubleshoot it. 


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


rubayatyasmin
Super User
Super User

Use MID func. 

 

=MID([ColumnName], FIND("(", [ColumnName], 1, LEN([ColumnName]), 0) + 1,
FIND(")", [ColumnName], 1, LEN([ColumnName]), 0) - FIND("(", [ColumnName], 1, LEN([ColumnName]), 0) - 1)

 

replace col name with actual column name . 

 

rubayatyasmin_0-1689517080227.png


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


Instead of 0 only u used len function then again using 0 how u used 0 ?

Here is the explanation of the formula:

  • FIND("(", [ColumnName], 1, LEN([ColumnName]), 0) + 1 - It finds the first character after the opening bracket.
  • FIND(")", [ColumnName], 1, LEN([ColumnName]), 0) - FIND("(", [ColumnName], 1, LEN([ColumnName]), 0) - 1 - It calculates the number of characters to extract.
  • MID([ColumnName], ..., ...) - This function will then extract the required number of characters starting from the specified position.

Also, know the details of the Find function. 

 

rubayatyasmin_0-1690535308734.png

 

refer: https://learn.microsoft.com/en-us/dax/find-function-dax

 

rubayatyasmin_0-1689517080227.png

 


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


Kaagaz_20230728_212620832675-1 (1).jpg

IMG_20230728_212316.jpg

  in my above code wht is the error bro . output showing head office crtly but N/A only showing A alone not showing N/A any error in my code plz tell 

Bro for find function only 4 input but u extra added 0 also .find ("(", column name , 1 ( starting position), len ( not found value )) 

0 - not found value,

 

try using this code without LEN func and not_found_value param.

note: the following code assumes you have brackets in all the rows. 

MID([ColumnName],
FIND("(", [ColumnName]) + 1,
FIND(")", [ColumnName]) - FIND("(", [ColumnName]) - 1)

 

MID([ColumnName], start_position, num_characters): MID function returns a string of characters from the middle of a text string, given a starting position and length. Here, the starting position and length are determined by the other two parts of the expression.

 

rubayatyasmin_0-1689517080227.png


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


rubayatyasmin
Super User
Super User

Hi, @Karthikgayathri 

 

Go to power query and use Split by Delimiter. Set the delimiter to (, it will split it in a new column. Rename the column. this kind of changes fall under data transformation. No need to write DAX for it. Power Query has it's own functionality to handle these sort of stuff. 

 

Refer to this document : https://learn.microsoft.com/en-us/power-query/split-columns-delimiter

 

rubayatyasmin_0-1689517080227.png


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


Bro I need dax formula by using left ,right ,mid functions 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.