Forum Discussion
datedif Function, only for working days (mon-Fri)
- 8 years ago
Did you use a disconnected table?
Thank u so far!
There is no reason for not using the datediff function, I just didn´t know that it´s possible in DAX.
then you will need to add the isworkingday to your calculation, not sure what you are working out below, is there a reason you not using the datediff function?
Tage_seit_erster_Objektbegung = if(KontElemente[Datum der Besichtigung]<>BLANK();TODAY()-KontElemente[Datum der Besichtigung].[Date];BLANK())
I´m trying to show the difference in days between the [Datum der Besichtigung] and today (but only the weekdays). If [Datum der Besichtigung] is empty there should be no calculation. I´m not really sure how to install the isworkingday in the formula..
Would be grateful if u can help me out
BachFel not sure if i have captured what you have asked for but give it a go
assuming you have created a date table which is what is required and then created a relationship on that date to the date in your table
Tage_seit_erster_Objektbegung =
IF (
ISBLANK ( datetable[date] ),
BLANK (),
IF ( isworkingday = 1, DATEDIFF ( datetable[date], TODAY (), DAY ), BLANK () )
)
- BachFel8 years agoHelper II
Tage_seit_erster_Objektbegung =
IF (
ISBLANK (KontElemente[Datum der Besichtigung]);
BLANK ();
IF (Datumstabelle[AlleDaten]) = 1; DATEDIFF (KontElemente[Datum der Besichtigung]; TODAY (); DAY ); BLANK () )I´m not able to select the table Datumstabelle where the row AlleDaten is in...
I created a relationship as u mentioned but it won´t work.. I´m lost...
- vanessafvg8 years agoCommunity Champion
it looks like the relationship has been created, what error you getting?
- BachFel8 years agoHelper II
That there are to less arguments for using the if-function.
This is caused by the reason that I´m not able to find the table Datumstabelle I guess..
- vanessafvg8 years agoCommunity Champion
BachFel show me how you adjusted the formula?
- BachFel8 years agoHelper II
Tage_seit_erster_Objektbegung =
IF (
ISBLANK (KontElemente[Datum der Besichtigung]);
BLANK ();
IF(Datumstabelle[AlleDaten]) = 1; DATEDIFF (KontElemente[Datum der Besichtigung]; TODAY (); DAY ); BLANK () ) - vanessafvg8 years agoCommunity Champion
BachFel i meant the formula i gave you? have you adjusted it to your model? secondly you need to use the date table not the other table