Forum Discussion

RonaldvdH's avatar
RonaldvdH
Post Patron
6 years ago
Solved

Need help :)

Goodday guys, i need your help in correcting this formula because something is wrong and it returns an error

'The begin or enddate in the function Calendar can not be empty'

 

 
Doorlooptijd correctie Sisu in Werkdagen = VAR YourDate = if(IsBlank([Afgerond]); TODAY(); [Afgerond])
RETURN
COUNTROWS(
    FILTER(
ADDCOLUMNS(
            CALENDAR(
                [OA retour gestuurd];
                YourDate
            );
            "DayofWeek";
            WEEKDAY(
                [Date];
                2
            )
        );
        [DayofWeek] <> 6 && [DayofWeek] <> 7
    ))
 
 
  • sturlaws the column [OA retour gestuurd]  is a column with date values and yes it can be BLANK and that triggered me to change the formula to this and it seems to work

     

    Doorlooptijd correctie Sisu in Werkdagen = IF(Hoogbouwregistratie[OA retour gestuurd]<>BLANK();
    VAR YourDate = if(IsBlank([Afgerond]); TODAY(); [Afgerond])
    RETURN
    COUNTROWS(
        FILTER(
    ADDCOLUMNS(
                CALENDAR(
                    [OA retour gestuurd];
                    YourDate
                );
                "DayofWeek";
                WEEKDAY(
                    [Date];
                    2
                )
            );
            [DayofWeek] <> 6 && [DayofWeek] <> 7
        )))

2 Replies

  • sturlaws's avatar
    sturlaws
    Resident Rockstar

    Hi RonaldvdH,

    I am not able to recreate your issue with a simple dataset I created. Is  [OA retour gestuurd] a measure? I guess the reason for your error is that this value is blank.

     

    Cheers,
    Sturla

    If this post helps, then please consider Accepting it as the solution. Kudos are nice too.

    • RonaldvdH's avatar
      RonaldvdH
      Post Patron

      sturlaws the column [OA retour gestuurd]  is a column with date values and yes it can be BLANK and that triggered me to change the formula to this and it seems to work

       

      Doorlooptijd correctie Sisu in Werkdagen = IF(Hoogbouwregistratie[OA retour gestuurd]<>BLANK();
      VAR YourDate = if(IsBlank([Afgerond]); TODAY(); [Afgerond])
      RETURN
      COUNTROWS(
          FILTER(
      ADDCOLUMNS(
                  CALENDAR(
                      [OA retour gestuurd];
                      YourDate
                  );
                  "DayofWeek";
                  WEEKDAY(
                      [Date];
                      2
                  )
              );
              [DayofWeek] <> 6 && [DayofWeek] <> 7
          )))