Showing results for 
Search instead for 
Did you mean: 

Auto-Format Numbers in Billions, Millions, Thousands, etc.


I came across the need to have charts auto-format numbers depending on their size. For example, if numbers are in billions, format in billions. Same thing for millions and thousands. Would like to prevent users from having to scroll to see all the columns, and this would help in that regard.



Status: New
Advocate IV

Great idea. I've written DAX to do this dynamically. 

df Total = 
VAR SafeLog =
    IFERROR ( ABS(INT ( LOG ( ABS ( [Total] ), 1000 ) )), 0 )
VAR dp = 1
    ROUND ( DIVIDE ( [Total], 1000 ^ SafeLog ), dp )
        & SWITCH ( Safelog, 1, "K", 2, "M", 3, "bn", 4, "tn" )


See this Twitter thread:


Something similar can also be used inside Calculation Groups to keep the numbers as numbers, as per this thread: