Forum Discussion
PunkDoubtBI
7 years agoFrequent Visitor
Change a calculated column using Earlier () function to using a variable
I've read a blog by Alberto Ferrari saying that Earlier () should not be used and instead a variable should be created, but I cannot get it to work. Here is the working code using Earlier to fin...
- 7 years ago
Try deleting the .[Date] in red font below
StartDateNextStep_with_variable = var CurrentCreatedOn = 'Workflow ActivityHistory'[CreatedOn]
.[Date]var CurrentDocumentInstanceId = 'Workflow ActivityHistory'[DocumentInstanceId] RETURN Calculate(min('Workflow ActivityHistory'[CreatedOn]), filter('Workflow ActivityHistory', 'Workflow ActivityHistory'[DocumentInstanceId] = CurrentDocumentInstanceId && 'Workflow ActivityHistory'[CreatedOn] > CurrentCreatedOn ) )
Zubair_Muhammad
7 years agoCommunity Champion
Try deleting the .[Date] in red font below
StartDateNextStep_with_variable = var CurrentCreatedOn = 'Workflow ActivityHistory'[CreatedOn].[Date]var CurrentDocumentInstanceId = 'Workflow ActivityHistory'[DocumentInstanceId] RETURN Calculate(min('Workflow ActivityHistory'[CreatedOn]), filter('Workflow ActivityHistory', 'Workflow ActivityHistory'[DocumentInstanceId] = CurrentDocumentInstanceId && 'Workflow ActivityHistory'[CreatedOn] > CurrentCreatedOn ) )
PunkDoubtBI
6 years agoFrequent Visitor
Removing .[date] worked, thank you. I didn't even notice that intellisense had added this.