Forum Discussion

aleuer's avatar
aleuer
Frequent Visitor
9 years ago

Find duplicate column values by calculated measures

Hi Everyone, 

I'm very new to DAX and PowerBi in general, but I'm looking to see if I can't find a way to indicate a duplicated column value based on calculated measures to put my results on a singular line of data. 

 

Shown below: 'ProjectNumber' is the column value and 'TotalWords' and 'Measure2' are calculated measures. I'd like to be able to indicate duplicate column values(ProjectNumber) based on these measures to view my data on a single line. E.g. ProjectNumber 10146113 would appear with a value for both TotalWords+Measure2. 

 

The the VENDOR for Measure2 is not of importance either, as I'm really looking for the VENDOR with a value in TotalWords to take precedence. 

 

 

 

Any help would be greatly appreciated!

 

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    HI aleuer,


    I think measure 2 use to check if projectnumber contains duplicate records, right?

     

    If this is a case, you can try to use below formula to achieve your requirement: (duplicate return 1)

     

    Result= IF(COUNTROWS(FILTER(ALL('Table'),[ProjectNumber]=MAX([ProjectNumber])))>=2,1,"TotalWords formula")

     

    Notice: please put your totalwords formula to replace the bold part.

     

     

    Regards,

    Xiaoxin Sheng

    • aleuer's avatar
      aleuer
      Frequent Visitor

      Hi Xiaoxin!

       

      Thank you so much for your reply! Unfortunately, the formula "Measure" provided yielded a 1.00 value for all project numbers :( .  I've renamed 'measure 2' to Activity. Activity describes activity within Project number that I need to associate to the TotalWord value. I've tried concatenating the ProjectNumber and Language columns and using DISTINCTCOUNT to indicate duplicate values - no success. Any further advice here is greatly appreciated!

      Thanks!

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi aleuer,

         

        For my measure, it check the duplicate project and return 1 to instead of totalwords.


        Based on your screenshots, I think it need to add more conditions to filter records. So, can you share the sample file to test?

        You can upload to onedrive or google drive, then share the link here.

         

        Regards,

        XIaoxin Sheng