Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Help with model fix

Hello,

I have an issue with my model, it was working perfectly but all of a sudden I am getting the below error. It relates to one of the formula below howver I can not find anything wrong with the formula. Additionally, if I refresh each of the tables individually on transform data it works however if I hit refresh on the visuals then it gives the below error. Please help I am not entirely sure what wrong or how to fix. I have also sent frown which directed m

HT - Days Worked =
VAR targetstartdate= SELECTEDVALUE('Global Staff Targets'[Target Start Date])
VAR endomonth = ENDOFMONTH(Dates[Date])
VAR startmonth = STARTOFMONTH(Dates[Date])
VAR enddate =
IF(TODAY()>=endomonth,endomonth,TODAY()
)
VAR startdate =
IF(
targetstartdate<=startmonth,startmonth,targetstartdate
)
RETURN IF(DATEDIFF(startdate, enddate,DAY) <0,0, (DATEDIFF(startdate, enddate,DAY)))+1

 

1 Reply