Forum Discussion
Age defined by quarter
cabadart , Looking at this seem like you need a measure
countx(values(employee [Employee ID]), if(datediff(employee[Hiredate]<maxx('date'[date]),year)<=5, [Employee ID], blank()))
You should plot this with qtr, year from date table joined to hire date of the employee table
I attached my HR demo file, if that can help
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
amitchandak the measure you gave me is not quite right - it says "A single value for column 'HireDate' in table 'HireDate' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result"
I added MIN so my measure looks like this:
- v-yingjl5 years ago
Community Support
Hi cabadart ,
If there is a relationship between your date table and source table, basically the dax formula should work.
Or you can try to create the measure like this:
_Count = COUNTX ( FILTER ( 'HireDate', DATEDIFF ( 'HireDate'[HireDate], MAX ( 'Calendar'[Date] ), YEAR ) <= 5 ), [Alias] )Attached a sample file in the below, hopes it could help.
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.