Forum Discussion
Grouping by age
Hi Anonymous
Static Segmentation is probably the way to go, if you want to assign each row of your table to a group:
http://www.daxpatterns.com/static-segmentation/
Regards,
Owen
Thanks. That looks like exactly what I need.
Struggling to get it working though.
I have created a new table: Age Profile Ranges
Age Range Name
Max
Min
I then create a new calculated column under my existing table 'Current' and I'm trying to amend this expression to suit:
- Sean9 years ago
Community Champion
Anonymous
It seems you have it right? Are you getting an error or...?
Age Range = CALCULATE ( VALUES ( 'Age Profile Ranges'[Age Range Name] ), FILTER ( 'Age Profile Ranges', 'Current'[Incident Age (Days)] >= 'Age Profile Ranges'[Min] && 'Current'[Incident Age (Days)] < 'Age Profile Ranges'[Max] ) )Alternatively you can create a COLUMN in your 'Current' table and use a SWITCH to create your groups like this...
Age Range ALT = SWITCH ( TRUE (), 'Current'[Incident Age (Days)] >= 0 && 'Current'[Incident Age (Days)] <= 5, "0-5 Days", 'Current'[Incident Age (Days)] > 5 && 'Current'[Incident Age (Days)] <= 20, "6-20 Days", 'Current'[Incident Age (Days)] > 20 && 'Current'[Incident Age (Days)] <= 50, "21-50 Days", ">50 Days" )That should do it also! :smileyhappy:
- Anonymous9 years agoNot applicable
It allows to to enter the expression but when trying to show a visual all counts are equal?
- Phil_Seamark9 years ago
Microsoft Employee
Hi Anonymous
Do you have a relationship between the 'Age Profile Ranges' table and 'Current' ?
- piccolo37a8 years agoNew Member
This post totally helped me group employee date of birth info into years for Generational analysis. Thank you! I had to calculate the date of birth for aging purposes, but for the year of birth...this was awesome.