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
Grosman
New Member

Reverse Text For a Specific Language In a Column

Hello,

 

I have a column with names written in 2 different languages.

I want to reverse the text only for a specific language out of the 2.

 

Any possible solution in M code?

 

Thank you.

1 ACCEPTED SOLUTION
ribisht17
Super User
Super User

@Grosman 

Please post some data, it won't help much, even then I see it as below

 

Step 1

Add an INDEX

Solved: Add calculated index column by DAX - Microsoft Power BI Community

 

Step 2

Now you have 2 columns

INDEX|LANGUAGE

1.English

2.Hindi

3.English

4.Hindi

 

Step 3

MOD(<number>, <divisor>)

MOD([INDEX],2)

 

Step 4

Step 3 will give you MOD as below

 

INDEX|LANGUAGE|MOD

1.English|1

2.Hindi|0

3.English|1

4.Hindi|0

 

Step 5

Now wherever you see 0, reverse the TEXT

 

Regards,

Ritesh

 

 

View solution in original post

6 REPLIES 6
ribisht17
Super User
Super User

@Grosman 

Please post some data, it won't help much, even then I see it as below

 

Step 1

Add an INDEX

Solved: Add calculated index column by DAX - Microsoft Power BI Community

 

Step 2

Now you have 2 columns

INDEX|LANGUAGE

1.English

2.Hindi

3.English

4.Hindi

 

Step 3

MOD(<number>, <divisor>)

MOD([INDEX],2)

 

Step 4

Step 3 will give you MOD as below

 

INDEX|LANGUAGE|MOD

1.English|1

2.Hindi|0

3.English|1

4.Hindi|0

 

Step 5

Now wherever you see 0, reverse the TEXT

 

Regards,

Ritesh

 

 

I have no indicator for the language if thats what you mean.

 

I only have the text itself but i dont know how to dynamically recognize the language and then reverse it only when its english.

If there is no indicator then "Not possible"

Post some sample dummy data here to see the feasibility

ribisht17
Super User
Super User

@Grosman 

 

Solved: Reverse Text - Microsoft Power BI Community

 

Not sure how do we go to specific language, information missing 

For example if we have something like below with delimiter -

Hindi Name-English Name

Step 1

Split into 

Column1|Column2

Hindi Name| English Name

 

Step2

Apply this to Column Name-2>> Solved: Reverse Text - Microsoft Power BI Community

 

Last Step

We can combine Column1 and Step2 again with -

Hindi Name|EmaN IdniH

 

Regards,

Ritesh

 

Regards,

Ritesh

I have 2 languages, but each one in a different line so i dont need to split.

I only need to reverse the english lines and not the other language lines.

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.