0
votes

I am working on a SSRS report which requires a chart to show vertical axis in 'M' or 'K' like 0, 2M, 4M. I got a custom formatting formula which adds an 'M' or 'K' with numbers -

=Switch(Fields!TotalSpendCurrent.Value < 1000, "0.#", Fields!TotalSpendCurrent.Value < 1000000, "#,.#K", true, "#,,M")

But with this I am getting 'M' or 'K' as minimum value not 0.

enter image description here

Current Output Screen

enter image description here

1
Can you show us some data! Or you can use Format function to apply on condition base!pedram
You can assume any data which is more than 1000000 and I need to represent it on chart's vertical axis starting as 0, 2M, 4M. For example - you have Total Spend with maximum value of 16000000 and Month for X axis from June to Dec.AmiV
So if Fields!TotalSpendCurrent.Value is less than 1000 then you want to show 0 right? not Mpedram
Yes, that is what I am trying to get.AmiV
Seems you are very new to SSRS, can you please provide current actual output screen!pedram

1 Answers

-1
votes

Try this,

=Switch(CInt(Fields!TotalSpendCurrent.Value) < 1000, Format(Fields!TotalSpendCurrent.Value,"0.#"), 
CInt(Fields!TotalSpendCurrent.Value) < 1000000, Format(Fields!TotalSpendCurrent.Value,"#,.#K"), 
true, Format(Fields!TotalSpendCurrent.Value,"#,,M"))

Let me if it works or not!