When working with text data in Tableau, you’ll often need to clean or reshape strings to better fit your analysis or visual presentation.

Abbreviating text is a common challenge when designing dashboards, reports, or any interface where space is limited. Whether you’re working with long product names, category labels, or freeform text fields, overly long strings can clutter layout and make visualizations harder to read.
I was working on a dashboard using the TV + Data dataset and wanted to include the synopsis of each episode next to the IMDB rating. To make everything fit while keeping the chart readable, I needed a way to abbreviate the text.
The easiest way: break on character length
One simple approach is using the LEFT()
function, which allows you to keep only the first few characters of a string. For instance, LEFT([Long Text], 40)
will return the first 40 letters of the text.
This method may be a bit too simplistic, as it doesn’t indicate that the text has been shortened. A common way to signal an abbreviation is by adding an ellipsis (“…”) at the end.
In the calculation we add this only to the text if the text is abbreviated:

In my visualization, it looks like this:

A cleaner break
As you can see in the example, the abbreviation technically works, but the result looks a bit rough—especially since words are cut off mid-word, making the text feel abrupt or unfinished.
It is much cleaner to keep the words intact. After fiddling around with regular expressions (which work – but often not working on live database connections) I ended up with this:

SPLIT([Long Text], " ", -1)
gets the last wordLEN
gives the length of that last word.LEN([Your Field]) - length of last word - 1
gives the length of the string without the last word and the space before it.LEFT(...)
returns everything except the last word.
This results in this view, where these sentences are better to read:

Full text in Tool tip
Of course – abbreviated text hides a possible important part of the data. If the text isn’t too long (say – under 1000 characters long) you can use the tool tip to show the full text:

Closing
The above mentioned simple string functions in Tableau are great for quick text abbreviations, they have their limits—especially when dealing with larger datasets or more complex formatting needs.
For better performance and more control, it can be worth offloading text processing to your data source using SQL, especially in tools like PostgreSQL or BigQuery.
Alternatively, if you want to maintain full-text visibility without cluttering your dashboard, you might consider using a Tableau Extension that shows the complete text on hover or click. I will show both of these options in more detail in a future post.