DAX code
Age Group =
VAR Age = DATEDIFF('Employee'[DateOfBirth], TODAY(), YEAR)
RETURN
SWITCH(
TRUE(),
Age < 25, "Under 25",
Age <= 34, "25-34",
Age <= 44, "35-44",
Age <= 54, "45-54",
"55+"
)
Buckets each employee into an age band for demographic reporting.
Type your table and column names once. Every measure below updates.
Age Group =
VAR Age = DATEDIFF('Employee'[DateOfBirth], TODAY(), YEAR)
RETURN
SWITCH(
TRUE(),
Age < 25, "Under 25",
Age <= 34, "25-34",
Age <= 44, "35-44",
Age <= 54, "45-54",
"55+"
)
This is written as a calculated column so it can be used to slice and group employees by age band in a visual.
Browse all 175 measures in the Power BI DAX Measures Library, or search the library for something similar to Headcount by Age Group.