Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Calculation of Years

I would like to create a new column called Number of Years served.

 

Number of years served = (Date he left - Date he joined)/365. Both these variables need to be accessed from the same table

 

I'm not able to figure out a way to do the subtraction. Is there any way this can be done? 

 

Thank You!

  • Anonymous's avatar
    Anonymous
    8 years ago

    Hi Anonymous

     

    I think you are trying to reference the columns in a measure, your formua should work in a calculated column.

     

    R you can try this as well:

     

    Column=DATEDIFF(Table1[Left_Date],Table1[joining_Date],YEAR)

     

    Thanks
    Raj

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous

     

    I think you are trying to reference the columns in a measure, your formua should work in a calculated column.

     

    R you can try this as well:

     

    Column=DATEDIFF(Table1[Left_Date],Table1[joining_Date],YEAR)

     

    Thanks
    Raj

    • Anonymous's avatar
      Anonymous
      Not applicable

      This worked, thank you!