Link to home
Start Free TrialLog in
Avatar of Gabe Lebron
Gabe LebronFlag for United States of America

asked on

Case statement in SSRS

I have a margin % field.  I need an 2 if statements, One that Looks at the Margin % and if it over 50%  change it to 50%  or if it under 0% change it to 0%  

then i want a if stament that if it is changed make it red..  

 User generated image
Avatar of johnnyaction

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Gabe Lebron


Hmmm i tryed it  User generated imagebut it shows the same
 User generated image
Avatar of johnnyaction

what is the data type for margin?
Avatar of Anthony Perkins
This is a duplicate question see here:
One of the two questions needs to be deleted or the points reduced in both.
This looks like a problem of datatype. How you are adding %? is it directly from the sql server or you changed the format from SSRS?
I created a Data Set in Layout...   So it not cooming from SSRS

I made an expression to get %
 User generated image
I mean its not comming from the Server .. I have a Expression thats calculated From 2 other data sets
And to add the %, you might have change the format of the textbox\column. Right?
Yes I changed it to P
Change the format style back to decimal or int and try once. I am sure this has something to do with the percentage formatting. For time being multiply the values with 100.
ok weird .. I tryed formatting to D or n and still nothing  then i tryed to add


i changed the data margin set to


and it worked..Some what  percent are high
 User generated image
this is the raw data .. is it because the data it .xxx   and the if statment uses   50?
Just needed to change 50 to .50  for it to work thank you
your very welcome