Forum Discussion

mohammadyousaf's avatar
mohammadyousaf
Resolver II
4 years ago
Solved

Combining IF Statements

Hi, can someone please help to combine these two statements.    Firs Statement:   IF(ISBLANK([Date.Actual.Start]),BLANK(),} IF(ISBLANK([Date.Actual.Completion]),BLANK(), (DATEDIFF([Date.Actual....
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi mohammadyousaf ,

    I created a sample pbix file(see attachment), please check whether that is what you want. You can create a measure as below to get the Days.Calculations:

    Days.Calculations = 
    VAR _tab =
        ADDCOLUMNS (
            'Table',
            "@datediff",
                IF (
                    ISBLANK ( [Actual Start] ),
                    BLANK (),
                    DATEDIFF (
                        [Actual Start],
                        IF ( ISBLANK ( [Actual Completion] ), TODAY () ),
                        DAY
                    ) + 1
                )
        )
    RETURN
        IF (
            ISFILTERED ( 'Table'[Task] ),
            SUMX ( _tab, [@datediff] ),
            MINX ( FILTER ( _tab, NOT ( ISBLANK ( [Actual Completion] ) ) ), [@datediff] )
        )

    Best Regards