0

The following measure

var growth = 
 IF([value]>0,"up by ",
  IF([value]=0,"flat at ",
   IF([value]<0,"down by ")))

With the above measure the values -0.1 or -0.001, etc are shown as down by while it should be shown as flat at.

Please let me know how to fix this on PowerBi

  • Why not just use ROUND function (DAX)? --> ... IF(ROUND([value],0)=0,"flat at ", ... – questionto42 Aug 24 '20 at 18:41
  • if I use that, it takes all negatives to 0 as well. If [value] is -5, it takes it as 0 – Vanessa Pinto Aug 24 '20 at 19:55
  • Strange, if I look at the examples at https://learn.microsoft.com/en-us/dax/round-function-dax I can see that it works as expected, ROUND(-5,0) should output -5. Should it not be that totally easy actually? Do you perhaps have a format on it so that the output is different from what it actually is, like at https://stackoverflow.com/questions/58017242/power-bi-dax-decimal-rounding? – questionto42 Aug 24 '20 at 20:07
  • 1
    I have converted the value to percent. – Vanessa Pinto Aug 24 '20 at 20:16
  • why value -0.1 or -0.001 should be shown as "flat at" where as you set "down by" when it is < 0? – mkRabbani Aug 25 '20 at 05:05

1 Answers1

0

since the value was in percent form round would just make it 0. The answer that worked for me was

IF(
    [value]*100>=1,"up by ",
        IF(([value]*100>-1)&&([value]*100<1),"flat at ",
            IF([value]*100<=-1,"down by ")))