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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
daouddajani
New Member

Reverse Text

is thier a way to flip (reverse) the contant of a field i.e volumn x has the value 12345 i need it to be displayed 321

1 ACCEPTED SOLUTION
curth
Power BI Team
Power BI Team

Are you reversing and truncating or just reversing? You can reverse text in M by saying

Text.Combine(List.Reverse(Text.ToList("12345")))

View solution in original post

6 REPLIES 6
curth
Power BI Team
Power BI Team

Are you reversing and truncating or just reversing? You can reverse text in M by saying

Text.Combine(List.Reverse(Text.ToList("12345")))

Hi..

 

Didn't find the text.combine function in the dax query..can u please help

Text.Combine is an M function available in Power Query, the ETL tool included in Power BI. DAX is the query language for Power Pivot/SSAS Tabular, the modelling and analytical engine in Power BI.

 

You can use Text.Combine in the get data portion of Power BI if you choose to edit the query.

Brilliant, missed that Text.ToList function when I scanned through the list of functions. Nice and clean.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Community Champion
Community Champion

Here's an Excel formula I found that you could probably adapt using equivalent DAX functions:

 

Type this formula:

 

=IF(LEN(A1)<1,"",MID(A1,LEN(A1),1))&IF(LEN(A1)<2,"",MID(A1,LEN(A1)-1,1))&IF(LEN(A1)<3,"",MID(A1,LEN(A1)-2,1))&IF(LEN(A1)<4,"",MID(A1,LEN(A1)-3,1))&IF(LEN(A1)<5,"",MID(A1,LEN(A1)-4,1))

 

DAX has LEN and MID formulas. Replace A1 with your column name.

 

Got the formula from here:

http://www.extendoffice.com/documents/excel/1146-excel-reverse-string-word-order.html#a1

 

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Community Champion
Community Champion

Nothing that I can find here:

https://msdn.microsoft.com/en-us/library/ee634938.aspx

 

 

You might be able to get there with some really nasty code that uses LEN and LEFT, etc.

 

I also looked here:

https://support.office.com/en-us/article/Power-Query-formula-categories-125024ec-873c-47b9-bdfd-b437...

 

 

M Code has a List.Reverse, but you have to get the string into a list format and Text.Split requires a delimiter so not sure how you might accomplish that one in M Code.

 

Probably a way but I'd have to think on it...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.