0

I have a Measure in Tableau which has to be display dynamically in Kilos, Millions , Billions and also formatted as 200k, 2726M.

lakshman
  • 41
  • 5

1 Answers1

0

You can try with this formula which you can expand on your needs:

str(
if SUM([Sales]) > 1000000000 THEN ROUND(SUM([Sales])/1000000000,1)
elseif SUM([Sales]) > 1000000 THEN ROUND(SUM([Sales])/1000000,1)
elseif SUM([Sales]) > 1000 THEN ROUND(SUM([Sales])/1000,1)
else SUM([Sales])
end )
+
if SUM([Sales]) > 1000000000 THEN 'B'
elseif SUM([Sales]) > 1000000 THEN 'M'
elseif SUM([Sales]) > 1000 THEN 'K'
else ''
end

See screenshot as quick example on Superstore: enter image description here

Fabio Fantoni
  • 3,077
  • 3
  • 22
  • 32