Forum Discussion
Anonymous
5 years agoNot applicable
Dynamic Age Groups - DAX
Hi, I am trying to represent the age demographic(with dynamic groups) across a workforce in DAX and I am having some trouble trying to represent it in the form of a graph. I have the following ...
- Anonymous5 years ago
Hi Anonymous ,
Try this measure.
Count = SWITCH ( MAX ( 'Table (2)'[Age Bracket] ), "18-24", CALCULATE ( COUNTROWS ( 'Table' ), FILTER ( 'Table', YEAR ( TODAY () ) - 24 <= YEAR ( [Date of Birth] ) && YEAR ( [Date of Birth] ) <= YEAR ( TODAY () ) - 18 ) ), "25-34", CALCULATE ( COUNTROWS ( 'Table' ), FILTER ( 'Table', YEAR ( TODAY () ) - 34 <= YEAR ( [Date of Birth] ) && YEAR ( [Date of Birth] ) <= YEAR ( TODAY () ) - 25 ) ), "Under 18", CALCULATE ( COUNTROWS ( 'Table' ), FILTER ( 'Table', YEAR ( TODAY () ) - 18 >= YEAR ( [Date of Birth] ) ) ) )Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Jihwan_Kim
5 years agoSuper User
Hi, Anonymous
Please check the below picture and the sample pbix file's link down below, whether it is what you are looking for.
all measures are in the sample pbix file.
https://www.dropbox.com/s/w3sl3bhq3f8utzh/leont3.pbix?dl=0
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.