Making Tableau follow AP style for dollar amounts in thousand and millions in tooltips

Tableau likes to format all its numbers the same way, like this:

$15M
$2.42M
$.45M

OR

$15,000,000
$2,420,000
$450,000

But AP wants us to do it like this:

$15 million
$2.4 million
$450,000

You can use two simple calculated fields to make Tableau show tooltip numbers in AP style:

  1. Convert millions to decimals with this calculated field:
    IF [Amount]>999999
    THEN (ROUND(([Amount]/1000000),2))
    ELSE [Amount]
    END
  2. Add the word million to the amount for the tooltip with another calculated field:
    IIF([Amount]>999999,”million”,””)
  3. Use both calculated fields (and add the $) in the tooltip:
    $<ATTR(Millions thousands calc)> <ATTR(Million for tooltip)>
Advertisements