Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
Source is a tabell with name, staff number, birthday and position.
for example:
I would like to group them by position and age, but I want to see how this look in 3-5 years, when I know that employe retirement at the age of 70.
Thanks
Solved! Go to Solution.
@fep - You could create an Age column like this:
Age =
VAR __Age = DATEDIFF([Date of Birth],TODAY(),YEAR)
RETURN
SWITCH(TRUE(),
__Age>=25 && __Age<30,"25-30",
__Age>=30 && __Age<50,"30-50",
__Age>=50 && __Age<70,"50-70"
)
For 3 years in the future, it would be this:
Age =
VAR __Age = DATEDIFF([Date of Birth],DATE(YEAR(TODAY())+3,MONTH(TODAY()),DAY(TODAY())),YEAR)
RETURN
SWITCH(TRUE(),
__Age>=25 && __Age<30,"25-30",
__Age>=30 && __Age<50,"30-50",
__Age>=50 && __Age<70,"50-70"
)
@fep , if you need to create a bucketing. You need to create age
Age column =
var _age = datediff ([date of birth],today(),year)
return
Switch( True(),
_age < 25, " 0 -25",
_age < 30, " 25 -30",
_age < 50, " 30 -50",
_age < 70, " 70 -70"
)
In case you need that is base on the selected date on page
Age measure = datediff ([date of birth],selectedvalue[date[date]) ,year)
Now you need have a bucket table with limits and have one more measure with the name in the row context to handle the same
For that refer
https://www.daxpatterns.com/dynamic-segmentation/
https://www.daxpatterns.com/static-segmentation/
https://radacad.com/dynamic-banding-or-grouping-in-power-bi-using-dax-measures-choose-the-size-of-bi...
https://www.credera.com/blog/technology-solutions/creating-aging-report-using-a-user-selected-date-i...
https://www.poweredsolutions.co/2020/01/11/dax-vs-power-query-static-segmentation-in-power-bi-dax-po...
https://radacad.com/grouping-and-binning-step-towards-better-data-visualization
@fep - You could create an Age column like this:
Age =
VAR __Age = DATEDIFF([Date of Birth],TODAY(),YEAR)
RETURN
SWITCH(TRUE(),
__Age>=25 && __Age<30,"25-30",
__Age>=30 && __Age<50,"30-50",
__Age>=50 && __Age<70,"50-70"
)
For 3 years in the future, it would be this:
Age =
VAR __Age = DATEDIFF([Date of Birth],DATE(YEAR(TODAY())+3,MONTH(TODAY()),DAY(TODAY())),YEAR)
RETURN
SWITCH(TRUE(),
__Age>=25 && __Age<30,"25-30",
__Age>=30 && __Age<50,"30-50",
__Age>=50 && __Age<70,"50-70"
)
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
68 | |
57 | |
52 | |
36 | |
34 |
User | Count |
---|---|
84 | |
71 | |
56 | |
45 | |
43 |