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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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