power BI exclude Duplicate Row with condition

32 views Asked by At
I have this table

enter image description here

which is a live connection from ssas to power BI I want to count duplicate based on typeName and wher completeDate is blank I wrote the folowing DAX

Duplicate = VAR Dup = COUNTROWS(FILTER('Table',EARLIER('Table'[typeName])='Table'[typeName]))
RETURN
         CALCULATE(Dup,
            FILTER('Table', 'Table'[CompletedDate]=BLANK()))

The current Output

enter image description here

which is wrong my desired output is to return where completeDate is blank

enter image description here

1

There are 1 answers

0
davidebacci On BEST ANSWER

Variables are actually constants. Does this work?

    Duplicate = 
CALCULATE(
    COUNTROWS(
        FILTER('Table',
            EARLIER('Table'[typeName])='Table'[typeName]
            && 'Table'[CompletedDate]=BLANK()
        )
    )
)