Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

New Column to Check if Duplicate, Add Marking

Hi there,

 

Im trying to build a column to check duplication of invoice invoice number. The result can be as follows:

 

I tried the posting here, https://community.powerbi.com/t5/Desktop/Add-column-where-the-first-duplicate-value-gets-value-1-and-the/m-p/900836 , but it doesnt work.

 

Thank you.

  • Anonymous 

    pls try this

    Column =
    VAR _count=CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[Index]<EARLIER('Table'[Index])&&'Table'[Invoice No]=EARLIER('Table'[Invoice No])))
    return if(ISBLANK(_count),'Table'[Invoice No],'Table'[Invoice No]&"-"&_count)
     

3 Replies

  • Anonymous 

    pls try this

    Column =
    VAR _count=CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[Index]<EARLIER('Table'[Index])&&'Table'[Invoice No]=EARLIER('Table'[Invoice No])))
    return if(ISBLANK(_count),'Table'[Invoice No],'Table'[Invoice No]&"-"&_count)
     
    • Anonymous's avatar
      Anonymous
      Not applicable

      Works like a charm! Thank you!