Forum Discussion
Grouping Age and Filter
- Anonymous6 years ago
Hi Anonymous ,
Create a column.
Column = DATEDIFF(Staff[Start Date],IF(ISBLANK(Staff[Resigned Date]),TODAY(),Staff[Resigned Date]),YEAR)Then create a measure.
Measure = IF ( SELECTEDVALUE ( Range[max] ) = 1, COUNTROWS ( FILTER ( Staff, Staff[Column] < SELECTEDVALUE ( Range[max] ) ) ), COUNTROWS ( FILTER ( Staff, Staff[Column] >= SELECTEDVALUE ( Range[min] ) && Staff[Column] <= SELECTEDVALUE ( Range[max] ) ) ) )The final result would be shown as below.
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I check it. The range is not a common attribute. Also, the tables are not joined. I think just cross join is filtering. I am surprised even the first filter is work.
Hi! amitchandak Okay... Is there anyway that we can find Age of Work at each year and do Age grouping.
- amitchandak6 years ago
Super User
Refer to attached file
try like
Current Age = CALCULATE(AVERAGEX(FILTER(Employee,Employee[Start Date]<=max('Date'[Date]) && (ISBLANK(Employee[End Date]) || Employee[End Date]>max('Date'[Date]))),DATEDIFF(min(Employee[Start Date]),max('Date'[Date]),MONTH)),CROSSFILTER(Employee[Start Date],'Date'[Date],None))- Anonymous6 years agoNot applicable
Thank you for your answer amitchandak . How can I do Age grouping like this picture?
- Anonymous6 years agoNot applicable
Hi Anonymous ,
Create a column.
Column = DATEDIFF(Staff[Start Date],IF(ISBLANK(Staff[Resigned Date]),TODAY(),Staff[Resigned Date]),YEAR)Then create a measure.
Measure = IF ( SELECTEDVALUE ( Range[max] ) = 1, COUNTROWS ( FILTER ( Staff, Staff[Column] < SELECTEDVALUE ( Range[max] ) ) ), COUNTROWS ( FILTER ( Staff, Staff[Column] >= SELECTEDVALUE ( Range[min] ) && Staff[Column] <= SELECTEDVALUE ( Range[max] ) ) ) )The final result would be shown as below.
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.