Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

How to calculate duplicate based on different column

Hi All,

 

I am new in Power BI and wanted to know how can I calculate duplicate in below situation.

 

NumberAssignment groupParent
1AXYZ
2BXYZ
3AXYZ

 

In this cases I want if Assignment group is different but parent is same then it will treat as a duplicate. So here 1 records we can consider duplicate.

 

Apprecaite any one of your help

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Anonymous ,

     

    We can update the measure.

    Record = COUNTROWS( DISTINCT(SELECTCOLUMNS('Table',"parent",[Parent],"group",[Assignment group])))

    If the above one can't help you get the desired result, please provide your expected result with backend logic.

     

    Best Regards,

    Neeko Tang

    If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    According to your description, here are my steps you can follow as a solution.

    (1) My test data is the same as yours.

    (2) We can create a measure. 

    Record = DISTINCTCOUNT('Table'[Parent])

    (3) Then the result is as follows.

     

    If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

     

    Best Regards,

    Neeko Tang

    If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi,

       

      Thanks for your reply but that solution not going to work as your doing disticnt only in one column. Let me tell my requirment once again.

       

      NumberAssignment groupParent
      1AXYZ
      2BXYZ
      3AXYZ

       

      Based on the above table either 1 & 2 consider as double or 2 & 3 consider as double. Not 1 & 3

       

       

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Anonymous ,

         

        We can update the measure.

        Record = COUNTROWS( DISTINCT(SELECTCOLUMNS('Table',"parent",[Parent],"group",[Assignment group])))

        If the above one can't help you get the desired result, please provide your expected result with backend logic.

         

        Best Regards,

        Neeko Tang

        If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly.