Forum Discussion
DateDiff with a BLANK value
RvdHeijden you could also do a switch ofr this could work
test =
IF (
IsWorkday = 1,
IF (
startdate = enddate,
1,
IF (
ISBLANK ( enddate ),
DATEDIFF ( startdate, TODAY (), DAY ),
DATEDIFF ( startdate, enddate, DAY )
)
),
BLANK ()
)
That wont work i think, the 'IsWorkday' is in the table 'Date' en the rest is in the table 'Klachten'
i have a relationship between both tables on 'Date' ofcourse but i think your formula needs to be changed
- vanessafvg9 years agoCommunity ChampionRvdHeijden try thistest =
IF (
RELATED ( Calendar[IsWorkday] ) = 1,
IF (
startdate = enddate,
1,
IF (
ISBLANK ( enddate ),
DATEDIFF ( startdate, TODAY (), DAY ),
DATEDIFF ( startdate, enddate, DAY )
)
),
BLANK ()
)- RvdHeijden9 years agoPost Prodigy
The formula doesn't return an error but it also does not return any values :)
You use datediff but shouldn't it be datesbetween ? it has to look in the date table to count the number of days between begin and end and then count the values 1 right ?
Doorlooptijd =
IF (
RELATED ( 'Date'[IsWorkday] ) = 1;
IF (
schades[binnengekomen] = Schades[gefiatteerd];
1;
IF (
ISBLANK ( Schades[gefiatteerd] );
DATEDIFF ( schades[binnengekomen]; TODAY (); DAY );
DATEDIFF ( schades[binnengekomen]; Schades[gefiatteerd]; DAY )
)
);
BLANK ()
)- vanessafvg9 years agoCommunity Champion
RvdHeijden why dates between, datediff calculates the days between 2 dates, isn't that what you wanted? that what you posted earlier. Dates between calculates a measure between a period
the isworkday columns is that an number or a text field?
datediff https://msdn.microsoft.com/en-gb/library/dn802538.aspx
datesbetween https://msdn.microsoft.com/en-us/library/ee634557.aspx
please post pics of your data and relationships if you want more help. or your pbix. i am working a bit blind here.