Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
j4jules
Regular Visitor

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

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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

ReqNamePBI.png

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi j4jules,
My solution in images.

 

ReqName1.png

 

[Distinct] measure image.

 

ReqName2.png


Tell us if works for you.

 

 

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.

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

Thank you very much!  These really helped.

Anonymous
Not applicable

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

ReqNamePBI.png

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Kudoed Authors