Forum Discussion
ArchStanton
Power Participant
4 years agoPrevious Date Offset - DAX Calculated Column
Hi, I have been using the link below to hopefully fix an issue where I need to calculate the DAYSBETWEEN the ActualStartDate & ActualEndDate using a calculated column. My problem is when the da...
ArchStanton
Power Participant
4 years agoPseudo Days =
VAR _countrowsID =
COUNTROWS ( FILTER ( Deferrals, Deferrals[regardingobjectid] = EARLIER ( Deferrals[Regardingobjectid] ) ) )
VAR _numberingrowsID =
COUNTROWS (
FILTER (
Deferrals,
Deferrals[Regardingobjectid] = EARLIER ( Deferrals[Regardingobjectid] )
&& Deferrals[ActualStart] <= EARLIER ( Deferrals[ActualStart] )
)
)
VAR _networkdaysAB =
NETWORKDAYS ( Deferrals[Case Received], Deferrals[ActualStart] )
VAR _previousrowactualend =
MAXX (
FILTER (
Deferrals,
Deferrals[Regardingobjectid] = EARLIER ( Deferrals[Regardingobjectid] )
&& Deferrals[ActualStart] < EARLIER ( Deferrals[ActualStart] )
),
Deferrals[ActualEnd]
)
VAR _networkdaysCB =
NETWORKDAYS ( _previousrowactualend, Deferrals[ActualStart] )
VAR _networkdaysAC =
NETWORKDAYS ( Deferrals[Case Received], Deferrals[ActualEnd] )
RETURN
SWITCH (
TRUE (),
_countrowsID = 2, IF ( _numberingrowsID = 1, _networkdaysAB, _networkdaysCB ),
_networkdaysAC
)v-yanjiang-msft
Community Support
4 years agoHi ArchStanton ,
Is your problem solved? If so, would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirment will find the solution quickly and benefit here, thank you!
Best Regards,
Community Support Team _ kalyj