Forum Discussion
bron12321
3 years agoFrequent Visitor
Return Date based on Conditions from same table
Hi, i've been trying to follow this: Solved: Date difference between values in same column - Microsoft Fabric Community Since I want to get a similar result. I need to calculate the difference in da...
- 3 years ago
After going away and coming back to it I've decided a new approach which I think works better:
Late2 =VAR varCurrentScenarioID = Master[UniqueID]VAR varCurrentEntryType = Master[EntryType]VAR varCurrentDate = Master[Date]VAR DateDifference =IF(varCurrentEntryType = "ForecastDate",DATEDIFF(varCurrentDate,LOOKUPVALUE(Master[Date],Master[UniqueID],varCurrentScenarioID,Master[EntryType],"BaselineDate"),DAY),blank())VAR Result =IF(DateDifference < 0, "Late",BLANK())RETURNResult
bron12321
3 years agoFrequent Visitor
After going away and coming back to it I've decided a new approach which I think works better:
Late2 =
VAR varCurrentScenarioID = Master[UniqueID]
VAR varCurrentEntryType = Master[EntryType]
VAR varCurrentDate = Master[Date]
VAR DateDifference =
IF(
varCurrentEntryType = "ForecastDate",
DATEDIFF(varCurrentDate,
LOOKUPVALUE(Master[Date],Master[UniqueID],varCurrentScenarioID,Master[EntryType],"BaselineDate"),
DAY),
blank()
)
VAR Result =
IF(DateDifference < 0, "Late",BLANK())
RETURN
Result