Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
nlopedebarrios
Contributor II
Contributor II

How to display money as abbreviated number?

I'd like to display money representing numbers the same way de Automatic format does, for example:

(using . as thousands separator and , as decimal)

  • 1.250.000 as $ 1,25M
  • 429.300 as $ 429,30K
  • 1.575.000.000 as $ 1.575M (NOT $ 1,57G)

is this possible?

Labels (2)
1 Solution

Accepted Solutions
QFabian
Specialist III
Specialist III

Hi @nlopedebarrios , here an option for what you want :

 

Example data : 

Data:
Load * INLINE [
Type, Amount
A, 1250000
B, 429300
C, 1575000000
];

Viz :

QFabian_0-1705074495389.png

Expression :

'$ ' & if(Sum(Amount) < 1000000,
num(Sum(Amount) / 1000, '#.##0,00') & ' K',
if(Sum(Amount) < 1000000000,
num(Sum(Amount) / 1000000, '#.##0,00') & ' M',
num(Sum(Amount) / 1000000, '#.##0') & ' M'))

QFabian

View solution in original post

3 Replies
QFabian
Specialist III
Specialist III

Hi @nlopedebarrios , here an option for what you want :

 

Example data : 

Data:
Load * INLINE [
Type, Amount
A, 1250000
B, 429300
C, 1575000000
];

Viz :

QFabian_0-1705074495389.png

Expression :

'$ ' & if(Sum(Amount) < 1000000,
num(Sum(Amount) / 1000, '#.##0,00') & ' K',
if(Sum(Amount) < 1000000000,
num(Sum(Amount) / 1000000, '#.##0,00') & ' M',
num(Sum(Amount) / 1000000, '#.##0') & ' M'))

QFabian
nlopedebarrios
Contributor II
Contributor II
Author

Thank you @QFabian !

nlopedebarrios
Contributor II
Contributor II
Author

Hi again, @QFabian, the solution works in a KPI, but when I try to use it in a bar o timeline chart, I'm getting this error:

The graph is not displayed because it only contains undefined values

 I've used the expression to create a master measure.

undefinedvalues.png