Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

IF Number Ends With

I have a number field with different data:

 

1.00

1.14

2.00

1.01

 

I want to write a formula that states if the number ends with .00 then "Parent", if not then "Child"

 

My formula below is only returning child. I am guessing it does not like the ".00" with the numbers above. 

 

Parent = IF(RIGHT('DataReader vSalesMaster'[SalesOrderLine], 3)=".00",
"Parent", "Child")

  • How about this instead:
    Parent =
    IF ( 'DataReader vSalesMaster'[SalesOrderLine] = TRUNC( 'DataReader vSalesMaster'[SalesOrderLine]), "Parent", "Child")
  • Hi,

     

    Try this calculated column formula

     

    =IF(MOD('DataReader vSalesMaster'[SalesOrderLine],1)=0,"Parent", "Child")

5 Replies

  • How about this instead:
    Parent =
    IF ( 'DataReader vSalesMaster'[SalesOrderLine] = TRUNC( 'DataReader vSalesMaster'[SalesOrderLine]), "Parent", "Child")
  • Hi,

     

    Try this calculated column formula

     

    =IF(MOD('DataReader vSalesMaster'[SalesOrderLine],1)=0,"Parent", "Child")

  • v-piga-msft's avatar
    v-piga-msft
    Resident Rockstar

    Hi Anonymous,

     

    By my tests, it seems that the replies from Ashish_Mathur and OwenAuger should be right.

     

    If you have solved your problem by the replies, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

     

    If you still need help, please feel free to ask.

     

    Best Regards,

    Cherry

    • Anonymous's avatar
      Anonymous
      Not applicable

      Both solutions work great! Thank you so much!