That worked! However, they only aligned when I used the custom format 00.0%, which adds a leading 0 to numbers less than 10% (e.g., 05.4%).
I also tried #0.0% (and combinations thereof), but that did not work.
I'd like them to align according to the first photo, just without the leading zeroes.
So one way to do this is to create 2 calculated fields, one for when the value is <10% and one where it is >=10%. The formulas are;
Notice how the ELSE condition is NULL. As Tableau doesn't plot NULLs (well it can't!), we can then place these 2 fields side by side in the text box
This then gives us independent formatting control over each field. We set up the >=10% as normal
and add in an extra 'Space' for the <10% one (well actually I added 2, as this seemed to line up better)
...as a very simple alternative, as the right part (decimal places and %) are the same for every value, Right Aligning the text would also line up the decimal points, without the need for the above method.
Hope this does the trick, and makes sense.
Allign Decimals.twbx 19.4 KB
1 of 1 people found this helpful
That was a nice little trick there, Shawn!