Power BITutorials

Top 5 Steps to Extract Age Using Date in Power Query

1 Mins read

Learn How to Extract Age using Date in Power Query. This is an amazing feature as it allows you to extract the age out of the date provided. Let us elaborate on this feature using an example. There are more similar functions that are very much useful in Power Query for Data Cleaning and Data Transformation Techniques. For that Join Our Complete Power Query Training with Lifetime Access and 24×7 Support.

Data Analytics Tricks in Power BI – Guidebook

You too can analyze data like a Data Scientist. No coding needed. No statistics needed.

Analyze & Visualize data using Power BI. (23 tricks in one book)

Steps to Extract Age Using Date With Power Query

Here, we have a data table containing employee information which includes their Date of the Birth column. If you want to calculate the age of each employee it will consume a lot of time. To overcome this, Power Query has a solution that can solve this problem within a fraction of second.

Step 1: Select Column before Adding Age

To add an age column, we first have to select the DOB (date of Birth) column as shown in the picture below.

SELECT COLUMN FOR ADDING AGE

Step 2: Calculate Age from Date Column

To calculate age using DOB column in Power Query, go to-

Add Column > Date > Age

CALCULATE AGE FROM DATE COLUMN

Step 3: After Age Column for Formatting

After you add the age column it is presented in the time format. To convert it into years you need to first select the column as shown below.

AFTER ADDING AGE COLUMN

Step 4: Convert Age from Time to Years Format

To convert age column from time format to years format, go to-

Transform > Duration > Total Years

CONVERT AGE FROM TIME TO YEARS FORMAT

Step 5: Round Down Age Column

After selecting the Total Years option, your Age column will get converted into age. To round down the age click on the Rounding option and select Round Down. The picture below shows the final output.

AFTER CONVERTING DATE TO AGE

Data Analytics Tricks in Power BI – Guidebook

You too can analyze data like a Data Scientist. No coding needed. No statistics needed.

Analyze & Visualize data using Power BI. (23 tricks in one book)

Related posts
AlteryxTutorials

Alteryx Hotkeys - Alteryx Keyboard Shortcuts

2 Mins read
Top 50+ Alteryx Shortcuts for Windows. Alteryx is popularly known as a Self-Service Analytics tool. Business users can build their data workflows…
AlteryxTutorials

Step By Step Guide to Learn Alteryx

6 Mins read
Alteryx Learning Path: The growth in technology has resulted in growth in understanding. In today’s world, humans – fellow businessmen know the…
Excel VBA CodeTutorials

VBA Code to Clean the Date Format

1 Mins read
When it is useful? Most of the time the most annoying problem is when the data is taken from ERP or other…