Forum Discussion
Date difference in same column for different stage in text format
- Anonymous3 years ago
Hi Antonio195754 ,
I think there should be multiple projects which should be keynames and there are multiple stages in them.
Please try this code to create a calculated column.
DateDiff = VAR _PreviousDate = CALCULATE ( MAX ( 'B Opportunity with History'[CREATEDATE] ), FILTER ( ALLEXCEPT ( 'B Opportunity with History', 'B Opportunity with History'[Project] ), 'B Opportunity with History'[CREATEDATE] < EARLIER ( 'B Opportunity with History'[CREATEDATE] ) ) ) VAR _DATEDIFF = DATEDIFF ( IF ( _PreviousDate = BLANK (), 'B Opportunity with History'[CREATEDATE], _PreviousDate ), 'B Opportunity with History'[CREATEDATE], DAY ) RETURN _DATEDIFFResult is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you Anonymous and to your point, it does make sense that we need to include what i'll call the "sale ID" in the formula. When I plug that into PBI i get this error when trying to replace the measures i need. In the screenshot are the actual measures i'm using. Opportunity_Type_C being the Sale ID.
I figured out why it wasn't taking, but now it's saying i'm out of memory. Let me work on cleaning up these tables i no longer am using and see if i can get your recommendation to work for me. Thank you!