Forum Discussion
Minor adjustment ?
I need to alter this formula so that is can deal with blank values.
This formula works if the column always has a value but now i want to use this formula for another column which may contain blank values and then the formula needs to skip that row.
Basically it only has to calculate if the colum 'OA retour gestuurd' has a (date) value that is why i thought i could use the red part in the formula but then it returns an error. When i skipp the red part it returns the error dat the begin and enddate in a calendar function cannot be empty.
4 Replies
- v-eachen-msftCommunity Support
Hi RonaldvdH ,
You could replace "null" with "blank()" or use NOT(ISBLANK( Your logic )) . DAX unrecognizes the meaning of "null".
- RonaldvdHPost Patron
v-eachen-msft both options return errors im afraid.
Doorlooptijd correctie Sisu in Werkdagen = VAR YourDate = if(IsBlank([Afgerond]); TODAY(); [Afgerond])RETURNCOUNTROWS( if(not(ISBLANK(Query1[OA retour gestuurd];FILTER(ADDCOLUMNS(CALENDAR([OA retour gestuurd];YourDate);"DayofWeek";WEEKDAY([Date];2));[DayofWeek] <> 6 && [DayofWeek] <> 7)))))- v-eachen-msftCommunity Support
Hi RonaldvdH ,
After my testing, I found that you have wrong brackets(your "not" and "isblank" functions have wrong brackets). You could try the following DAX.
Doorlooptijd correctie Sisu in Werkdagen = VAR YourDate = IF ( ISBLANK ( [Afgerond] ); TODAY (); [Afgerond] ) RETURN COUNTROWS ( IF ( NOT ( ISBLANK ( Query1[OA retour gestuurd] ) ); FILTER ( ADDCOLUMNS ( CALENDAR ( [OA retour gestuurd]; YourDate ); "DayofWeek"; WEEKDAY ( [Date]; 2 ) ); [DayofWeek] <> 6 && [DayofWeek] <> 7 ) ) )