Forum Discussion
date subtraction in a column
Hi,
I want to subtract these two dates (Date entered position) in as calculated column? is this possible?
Employee Type Date entered position
| A | Admin | 9/10/2010 |
| A | Admin | 9/10/2010 |
| A | Mgr | 2/12/2013 |
| A | Mgr | 2/12/2013 |
I tried Rankx to rank both dates as 1 and 2, then can't really figure out how to subtract them after. Maybe earlier?
Not sure.
thanks!
Peter
1 Reply
- v-kkf-msft
Community Support
Hi peterhui50 ,
Do you want to calculate the current date minus the value of the previous date for each employee? Then try the following calculated column.
NewColumn = VAR PreDate = CALCULATE ( MAX ( 'Table'[Date entered position] ), FILTER ( 'Table', 'Table'[Employee] = EARLIER ( 'Table'[Employee] ) && 'Table'[Date entered position] < EARLIER ( 'Table'[Date entered position] ) ) ) RETURN DATEDIFF ( PreDate, 'Table'[Date entered position], DAY )If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.