Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Missunderstandig about If statement

Hi fellows,

 

Im trying to make a if statement but there must be something wrong on my calculated column. Best way is show you what i am doing.

 

Importe Neto LY = CALCULATE(SUM('Ratios y Metricas'[Importe Neto]);FILTER('Detalles Fechas';'Detalles Fechas'[Año Fiscal]="FY 2018"))
 
Range = IF([Importe Neto LY] >= 0&&[Importe Neto LY] <= 500000;"0-500000";"Dif")
 
 
As you can see isnt work fine, it seems pretty basic but I dont understand what am i doing wrong
 
can you somebody help me to do a if statement based over calculated column in order to get a net range based net sales??
 
Thanks in advanced
  • Hi Anonymous ,

     

    Could you please try create the Importe Neto LY as a measure to use. Based on my test, it works fine on my side.

     

     

     

     

    BTW, pbix as attached.

     

    Best regards,

    Community Support Team _ Dong Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

5 Replies

  • v-lid-msft's avatar
    v-lid-msft
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

     

    Could you please try create the Importe Neto LY as a measure to use. Based on my test, it works fine on my side.

     

     

     

     

    BTW, pbix as attached.

     

    Best regards,

    Community Support Team _ Dong Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Indeed! works! 

       

      Now, can I create a multiple if statements to achieve several conditions?

       

      Range = var r = CALCULATE([Importe Neto LY]) return (IF(r >= 0&&r <= 500;"0-500";IF(r >= 501&&r <= 50000;"501-50000";"Dif")))

       

      I want to create IF and Else to put some net sales range's.

       

      Regards

      • v-lid-msft's avatar
        v-lid-msft
        Icon for Community Support rankCommunity Support

        Hi Anonymous ,

         

        How about the result after you follow the suggestions mentioned in my original post?Could you please provide more details about it If it doesn't meet your requirement?

         

        Best regards,

        Community Support Team _ Dong Li
        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.