Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
RonaldvdH
Post Patron
Post Patron

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.

 

Doorlooptijd correctie Sisu in Werkdagen = VAR YourDate = if(IsBlank([Afgerond]); TODAY(); [Afgerond])
RETURN
COUNTROWS( IF(Query1[OA retour gestuurd]<>null;
    FILTER(
ADDCOLUMNS(
            CALENDAR(
                [OA retour gestuurd];
                YourDate
            );
            "DayofWeek";
            WEEKDAY(
                [Date];
                2
            )
        );
        [DayofWeek] <> 6 && [DayofWeek] <> 7
    )))
4 REPLIES 4
v-eachen-msft
Community Support
Community Support

Hi @RonaldvdH ,

 

You could replace "null" with "blank()" or use NOT(ISBLANK( Your logic )) . DAX unrecognizes the meaning of "null".

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

@v-eachen-msft both options return errors im afraid. 

 

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
    )))))

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
            )
        )
    )

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

@v-eachen-msft  i believe we are almost there but this formula still returns an error

The expression refers to multiple columns. Multiple colums can't be converted to a scalair scale

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.