Forum Discussion
Getting row values from another row based on associated texts
- 4 years ago
Hi Anonymous
Try this new code to add a column:
Calculated Value = VAR _A = SWITCH ( TRUE (), [ObjectName] = "Project Initiation Phase", "M02 - Approve Fee Proposal", [ObjectName] = "Scope and Feasibility", "M04 - Approve Phase 1 Report", [ObjectName] = "Design Phase", "M12 - Approve Phase 2 Report", [ObjectName] = "Delivery Phase", "M23 - Issue Certificate of Completion", [ObjectName] = "Hand Over/Take Over Phase", "M24 - Recommend Hand Over Acceptance", [ObjectName] = "Project Close Phase", "M25 - Reduce PO Values To Zero", [ObjectName] = "Scope and Feasibility Phase", "Scope and Feasibility Phase", BLANK () ) VAR _B = IF ( ISBLANK ( _A ), BLANK (), CALCULATE ( MAX ( 'Table'[ActualFinishDate] ), FILTER ( ALL ( 'Table' ), [ObjectName] = _A && [ProjectName] = EARLIER ( 'Table'[ProjectName] ) ) ) ) RETURN IF ( ISBLANK ( _B ), CALCULATE ( MAX ( 'Table'[FinishDate] ), FILTER ( ALL ( 'Table' ), [ObjectName] = _A && [ProjectName] = EARLIER ( 'Table'[ProjectName] ) ) ), _B )Output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
How did you find that 11/10/2021 instead of 00/00/0000 for project close project 2000? there is no date like that in your table?
can you add more details?
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
Hi Vahid,
Can you see the updated dataset I have provided you above?
- VahidDM4 years ago
Super User
Hi Anonymous
Try this new code to add a column:
Calculated Value = VAR _A = SWITCH ( TRUE (), [ObjectName] = "Project Initiation Phase", "M02 - Approve Fee Proposal", [ObjectName] = "Scope and Feasibility", "M04 - Approve Phase 1 Report", [ObjectName] = "Design Phase", "M12 - Approve Phase 2 Report", [ObjectName] = "Delivery Phase", "M23 - Issue Certificate of Completion", [ObjectName] = "Hand Over/Take Over Phase", "M24 - Recommend Hand Over Acceptance", [ObjectName] = "Project Close Phase", "M25 - Reduce PO Values To Zero", [ObjectName] = "Scope and Feasibility Phase", "Scope and Feasibility Phase", BLANK () ) VAR _B = IF ( ISBLANK ( _A ), BLANK (), CALCULATE ( MAX ( 'Table'[ActualFinishDate] ), FILTER ( ALL ( 'Table' ), [ObjectName] = _A && [ProjectName] = EARLIER ( 'Table'[ProjectName] ) ) ) ) RETURN IF ( ISBLANK ( _B ), CALCULATE ( MAX ( 'Table'[FinishDate] ), FILTER ( ALL ( 'Table' ), [ObjectName] = _A && [ProjectName] = EARLIER ( 'Table'[ProjectName] ) ) ), _B )Output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/ - Anonymous4 years agoNot applicable
Thanks Vahid-that was brilliant scripting that helped a lot! 🙂
- Anonymous4 years agoNot applicable
See this particular row in the dataset.
2000 M25 - Reduce PO Values To Zero 00/00/0000 00/00/0000 11.10.2021 - VahidDM4 years ago
Super User
No Worries 🙏