Forum Discussion
AP_83
4 years agoRegular Visitor
iterate between dates in same column
This is sample records from a table, which has data for 2 tasks coulmn name is number for that. 1. For each task i have to find the most recent startTime and get the Group for that. IE. fo...
- Anonymous4 years ago
Hi AP_83 ,
Please create following measures:
Last = VAR _maxDate = MAXX ( FILTER ( ALL ( 'Table' ), [Number] = MAX ( 'Table'[Number] ) ), [StartTime] ) RETURN CALCULATE ( MAX ( 'Table'[Group] ), FILTER ( ALL ( 'Table' ), [Number] = MAX ( 'Table'[Number] ) && [StartTime] = _maxDate ) )Last_Group = IF(MAX('Table'[Group]) =[Last],[Last])Last_StartTime = IF(MAX('Table'[Group]) =[Last],MAX('Table'[StartTime]))Entire Task = VAR _min = MINX ( FILTER ( ALL ( 'Table' ), [Number] = MAX ( 'Table'[Number] ) ), [Last_StartTime] ) VAR _max = MAXX ( FILTER ( ALL ( 'Table' ), [Number] = MAX ( 'Table'[Number] ) ), [Last_StartTime] ) RETURN IF ( MAX ( 'Table'[StartTime] ) >= _min && MAX ( 'Table'[StartTime] ) <= _max, IF ( MAX ( 'Table'[AG_Type] ) = "Primary Assignment" && SELECTEDVALUE ( 'Table'[myVendor] ) = TRUE (), "Auto", "Non-Auto" ), BLANK () )Output:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ryan_mayu
Super User
4 years agonot clear about this.
1. get the last record for each task and get group name
2. find the same group name for the same task
3. we can get the min date and max date for each task, then why do you need these dates?
4. what are the next steps?
pls paste the sample data , not the screenshot.