Forum Discussion

j4jules's avatar
j4jules
Regular Visitor
7 years ago
Solved

Selectively remove duplicate rows based upon data in other cells

Hi. I need some help regarding duplicate rows in a report. I have the following data and need to create a pivot table as shown below plus a bar chart. I need counts of all of the Req Names but not where there is another row with that same Req Name for the Policy # and show them by Office #. The Req Order Placed, Req Order Recieived and Description might be different, however I only need to count the number of distinct Req Names a policy had. I have created the Matrix but I am not sure of the best way to remove the duplicates in this situation. Any suggestions are appreciated.  I can change the report or the SQL.  Thank you in advance.

Office #Policy #AgentReq Order PlacedReq Order ReceivedDescriptionReq Name
112345John Smith10/22/201810/22/2018Description ABCPaystub
112345John Smith10/23/2018 Description DEF - AOmission
112345John Smith10/23/2018 Description DEF - BOmission
112345John Smith10/23/2018 Description DEF - COmission
112345John Smith10/23/2018 Description DEF - DOmission
745678Jane Johnson9/18/2018 Description GHIPDA
745679Jane Johnson9/18/201810/1/2018Description GHIPDA
1821314Sam Jones10/25/2018 Description MNOBlood
1210111Al Jackson10/1/2018 Description DEF - BOmission
1210111Al Jackson10/1/201810/18/2018Description DEF - BOmission
116151Cindy Louis9/10/20189/18/2018Description JKL - for Signed and DatedIllustration
116151Cindy Louis9/18/20189/18/2018Description JKL - for SignatureIllustration
116151Cindy Louis9/23/2018 Description GHIPDA
116151Cindy Louis9/23/20189/23/2018Description GHIPDA
       
Need:      
Office #PaystubOmissionBloodPDAIllustrationGrand Total
111 114
7   1 1
12 1   1
18  1  1
Grand Total121217

 

 

  • Anonymous's avatar
    Anonymous
    7 years ago

    Answer was made in Power Pivot
    So it's exactly the same in PBI.

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi j4jules,
    My solution in images.

     

     

    [Distinct] measure image.

     


    Tell us if works for you.

     

     

    • j4jules's avatar
      j4jules
      Regular Visitor

      Thank you so much for your reply.  I need to do this in Power BI or the SQL that I use to pull the data in.  I will see if I can do your method in Power BI.

      • alena2k's avatar
        alena2k
        Resolver IV

        My first idea was simply create a measure Req Count = DISTINCTCOUNT(Table1[Policy #])
        It would eliminate dups but it will not give you a totals you are looking for.

         

        So, try to add a calculated column Key = COMBINEVALUES(" ", Table1[Req Name], Table1[Policy #]) and use it DISTINCTCOUNT:

         

        Key Count = DISTINCTCOUNT(Table1[Key])

         

        It shoudl do the trick