Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

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!

1 ACCEPTED SOLUTION
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

View solution in original post

2 REPLIES 2
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
Not applicable

This worked, thank you!

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors