powerbidaxpowerbi-desktopcalculated-columnscalculated-field

power BI exclude Duplicate Row with condition


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


Solution

  • Variables are actually constants. Does this work?

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