Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
Hi @Karthikgayathri
Please try
Bill to Customer 2 =
SUBSTITUTE ( SUBSTITUTE ( dimCustomer[Bill to Customer], ")", "" ), "(", "" )
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 )
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.
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
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 )
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 .
@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.
Proud to be a 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 .
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:
Also, know the details of the Find function.
refer: https://learn.microsoft.com/en-us/dax/find-function-dax
Proud to be a Super User!
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.
Proud to be a 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
Proud to be a Super User!
Bro I need dax formula by using left ,right ,mid functions
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
7 | |
7 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |