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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
iamsergeyka
Frequent Visitor

DAX: substitution of all Cyrillic letters with English letters (transliteration)

Hi all DAX gurus. My question is easy to solve in Excel with VBA but in Power BI (for me)
I was bit stucked but find my way and question is about optimisation!

So, column has _calculated_ values as string e.g. "СТОЛ","СТУЛ","ДВЕРЬ" in Russinan language. I would like to make those values readable for foreners and use transliteration and get them in new column written with latin letters as "STOL","STUL","DVER".
DAX SUBSTITUTE is looks like solution but only one by one charcter.

Why in DAX and not in M? Because column values are calculated (extracted from another column using specific logic).

 

So I add very simple but not optimal formula to get transliterated values:

 

 
Result translit =

VAR A1 = SUBSTITUTE([Column]," ","")
VAR A2 = SUBSTITUTE(A1,"А","A")
VAR A3 = SUBSTITUTE(A2,"Б","B")
VAR A4 = SUBSTITUTE(A3,"В","V")
VAR A5 = SUBSTITUTE(A4,"Г","G")
VAR A6 = SUBSTITUTE(A5,"Д","D")
VAR A7 = SUBSTITUTE(A6,"Е","E")
VAR A8 = SUBSTITUTE(A7,"ё","E")
VAR A9 = SUBSTITUTE(A8,"Ж","ZH")
VAR A10 = SUBSTITUTE(A9,"З","Z")
VAR A11 = SUBSTITUTE(A10,"И","I")
VAR A12 = SUBSTITUTE(A11,"К","K")
VAR A13 = SUBSTITUTE(A12,"Л","L")
VAR A14 = SUBSTITUTE(A13,"М","M")
VAR A15 = SUBSTITUTE(A14,"Н","N")
VAR A16 = SUBSTITUTE(A15,"О","O")
VAR A17 = SUBSTITUTE(A16,"П","P")
VAR A18 = SUBSTITUTE(A17,"Р","R")
VAR A19 = SUBSTITUTE(A18,"С","S")
VAR A20 = SUBSTITUTE(A19,"Т","T")
VAR A21 = SUBSTITUTE(A20,"У","U")
VAR A22 = SUBSTITUTE(A21,"Ф","F")
VAR A23 = SUBSTITUTE(A22,"Х","KH")
VAR A24 = SUBSTITUTE(A23,"Ц","TS")
VAR A25 = SUBSTITUTE(A24,"Ч","CH")
VAR A26 = SUBSTITUTE(A25,"Ш","SH")
VAR A27 = SUBSTITUTE(A26,"Щ","SHCH")
VAR A28 = SUBSTITUTE(A27,"Ь","")
VAR A29 = SUBSTITUTE(A28,"Ы","Y")
VAR A30 = SUBSTITUTE(A29,"Ъ","")
VAR A31 = SUBSTITUTE(A30,"Э","E")
VAR A32 = SUBSTITUTE(A31,"Ю","YU")
VAR A33 = SUBSTITUTE(A32,"Я","YA")
VAR A34 = SUBSTITUTE(A33,"Й","I")
RETURN
A34


 Question: is there suggestions to make it in more optimal/effective way?

3 REPLIES 3
iamsergeyka
Frequent Visitor

Hi @AnkitKukreja  , there are much more values in column with RU values than presented in example above, so original intension was to do all transliteration like letter-by-letter. I was thinking about loop with index table includes both ranges of letters but while/loop/cycle is not stanfdard functions in DAX. Anyway thanks!

Hi @iamsergeyka 

 

It would be great if you could share your pbix file and your requirement so we can help you with the same.
Just delete your PII data and share the sample here.

 

Thanks,

Ankit

For Power BI trainings or support dm or reach out to me on LinkedIn.
If my response has successfully addressed your question or concern, I kindly request that you mark this post as resolved. Additionally, if you found my assistance helpful, a thumbs-up would be greatly appreciated.

Thanks,
Ankit Kukreja
www.linkedin.com/in/ankit-kukreja1904
AnkitKukreja
Super User
Super User

Hi @iamsergeyka 

 

Please try something like this:

CommunitySolution.JPG

Russian Translation =
IF( Translate[Russian] = "СТОЛ" , "STOL" , IF( Translate[Russian] = "СТУЛ" , "STUL" , IF( Translate[Russian] = "ДВЕРЬ" , "DVER" , "NA" ) ) )
 
For Power BI trainings or support dm or reach out to me on LinkedIn.
If my response has successfully addressed your question or concern, I kindly request that you mark this post as resolved. Additionally, if you found my assistance helpful, a thumbs-up would be greatly appreciated.

Thanks,
Ankit Kukreja
www.linkedin.com/in/ankit-kukreja1904

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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