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

Number formatting changes billion/millions and setting by default to one decimal point

 I have used below code to get this format  but it's only for positive values not working for negative..

how can we make it work for  negative values(-)   ?

dual(num(sum(Value)/pow(10,3*floor(log10(sum(Value))/3)),'#,###.#'&pick(floor(log10(sum(Value))/3),'K','M','B')),sum(Value))

currently its not showing negative values in my trend line chart,,  Showing empty whenever negative values coming 

screenshot below:

 
 

pn.PNG

 

Could you please help me out..

@JonasValleskog  @sunny_talwar  @jagan 

Labels (1)
2 Replies
fosuzuki
Partner - Specialist III
Partner - Specialist III

The issue is that you cannot take a log10 of a negative value. Try this:

=dual(num(sum(Value)/pow(10,3*floor(log10(fabs(sum(Value)))/3)),'#,###.#'&pick(floor(log10(fabs(sum(Value)))/3),'K','M','B')),sum(Value))

 

Joel_Madras
Contributor II
Contributor II

Thanks it worked , the formula is more simple and compact ..