Forum Discussion

AlexGallet01's avatar
AlexGallet01
Helper IV
9 years ago

Problem with formula

Hello,

 

I have a problem with my formula and i don't understand why it's not possible to do this.

 

DIFF = CALCULATE(SUM(Commandes[LCCNVALCDE]);TEST[References.ValeursUtilise])-CALCULATE(SUM(Commandes[LCCNVALCDE]);IF(TEST[References.ValeursUtilise]<>"H-OF";TEST[References.ValeursUtilise]+1;""))

 

Commandes[LCCNVALCDE] -> type int

TEST[Refrences.ValeursUtilise] -> type string

 

H-OF is last value in my table so i want block this formula when TEST[Refrences.ValeursUtilise] =H-OF

7 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi AlexGallet01

     

     

    Make this as a calculated column first:

     

    Some column = IF(TEST[References.ValeursUtilise]<>"H-OF";TEST[References.ValeursUtilise]+1;BLANK())

     

     

    Then create your measures after and adjust them to your newly calculated column.

     

    Let me know how it goes.

     

    Best,

    Martin

    • AlexGallet01's avatar
      AlexGallet01
      Helper IV

      Hi ValubiMartin,

       

      I can't do this column i have an error message with value before H-OF.

      The message speak about impossible to convert my value type of string in int.

      • Anonymous's avatar
        Anonymous
        Not applicable

        Can you send me a picture of how your data is stored?