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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
rashid0146
Regular Visitor

converting difference between two dates into number of days

Hi All

 

I have two Columns. Date of Birth and Current Date. I have applied a simple formula in 3rd Column Age=[Current date]-[Date of Birth] I found the result in Date format. Now I want to convert 3rd column in number of days or number of years

 

Basically I want to calculate age in years in 3rd Column of 4th Column using the 3rd Column Information.

 

Best Regards

Rashid Anwar

2 ACCEPTED SOLUTIONS
hemantsingh
Helper V
Helper V

Hi @rashid0146,

 

 you can use datediff function in 3rd column only for finding the difference in years.

 

DATEDIFF(dateofbirth, currentdate, year)

Reagrds 

View solution in original post

Gnanasekar
Helper III
Helper III

Hi @rashid0146

 

can you below dax function to calculate difference between two date

Difference = DATEDIFF(<start_date>, <end_date>, <interval>)

For your case, use

Days = DATEDIFF(tablename[Date of birth], Today(),Days)

you will get days here.

 

By

Gnanasekar

View solution in original post

2 REPLIES 2
Gnanasekar
Helper III
Helper III

Hi @rashid0146

 

can you below dax function to calculate difference between two date

Difference = DATEDIFF(<start_date>, <end_date>, <interval>)

For your case, use

Days = DATEDIFF(tablename[Date of birth], Today(),Days)

you will get days here.

 

By

Gnanasekar

hemantsingh
Helper V
Helper V

Hi @rashid0146,

 

 you can use datediff function in 3rd column only for finding the difference in years.

 

DATEDIFF(dateofbirth, currentdate, year)

Reagrds 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Users online (1,256)