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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Help with DAX formula

Hi,

I have text data in one column (Japanese address in Alphabet), and I need to extract some data from the right.

 

Example:

ColumnA

123-52, ZZZZ, ZZZZZZ City, ZZZZZZ Prefecture, 1234567, JAPAN

 

and what I need to extract is "ZZZZZZ Prefecture, 1234567, JAPAN"

in other words, find the third "," from the right, and extract all the numbers and characters on the right hand side of that.

 

It might be a bit easier to find third comma from the left but I cannot use it since it could be third or fourth from the left depending on the format of the address, but it is always the third from right.

 

Thanks in advance !

 

 

1 ACCEPTED SOLUTION
zlokesh
Resolver I
Resolver I

Hi @Anonymous,

                      Please go through the below Screen shot, will solve your problem.

 

If you find this as solution "Accept as solution" else let me know Thanks.

 

Formula:-              NewColumn = SUBSTITUTE(REPLACE(SplitExample[Column1],1,7,""),",","") 

 

 

Comma ReplacementComma Replacement

View solution in original post

3 REPLIES 3
zlokesh
Resolver I
Resolver I

Hi @Anonymous,

                      Please go through the below Screen shot, will solve your problem.

 

If you find this as solution "Accept as solution" else let me know Thanks.

 

Formula:-              NewColumn = SUBSTITUTE(REPLACE(SplitExample[Column1],1,7,""),",","") 

 

 

Comma ReplacementComma Replacement

Thejeswar
Resident Rockstar
Resident Rockstar

There should be some coniditon based on which you are showing after last 2 commas or after last 3 commas. What is that?

Zubair_Muhammad
Community Champion
Community Champion

@Anonymous

 

How about splitting the Column from Query Editor/Power Query using "Comma" as a delimiter

 

Then you can recombine the last three columns


Regards
Zubair

Please try my custom visuals

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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