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 August 31st. Request your voucher.

Reply
jonnyA
Responsive Resident
Responsive Resident

I dont want my matrix to count duplicates

Good afternoon,

I'm using the following formula (I realize I may have to write a completely different formula) ...

What I'm trying to do is count the Note ID's, but not the duplicates Note ID's.

Count 95 and GT 3 =
CALCULATE (
COUNTROWS ( rpt_DD_DailyLog_Dataset ),
KEEPFILTERS ( rpt_DD_DailyLog_Dataset[Modifiers] in { "95", "GT", "GW~95", "GW~GT" }))
I exported my Power BI data to excel and below is a screenshot of a duplicate "Note ID".  I do not want Power BI to count the duplicate "Note ID".  The "Note ID" is being counted twice because there is a modifier on both CPT codes on the encounter.  And i only want to count "Note ID's" that have Modifiers "95", "GT", "GW~95", "GW~GT".  
 
 

Power BI Duplicate.PNG

Here is a screen shot of Power BI counting a duplicate "Note ID"...

Power BI 2.1.21 Part 2.PNG

How can I create a measure that doesnt count duplicate "Note ID's"??

Thank you in advance!

If you need add'l information i can provide that.

 

 

 
 
1 ACCEPTED SOLUTION
lkalawski
Super User
Super User

Hi @jonnyA 

Instead of using COUNTROWS you can use DISTINCTCOUNT for one column. In your case it will be

CALCULATE(DISTINCTCOUNT(rpt_DD_DailyLog_Dataset[Note_ID]), ...)

 

 

PBI_SuperUser_Rank@1x.png Proud to be a Super User.
If I helped, please accept the solution and give kudos
Linkedin

 

View solution in original post

2 REPLIES 2
lkalawski
Super User
Super User

Hi @jonnyA 

Instead of using COUNTROWS you can use DISTINCTCOUNT for one column. In your case it will be

CALCULATE(DISTINCTCOUNT(rpt_DD_DailyLog_Dataset[Note_ID]), ...)

 

 

PBI_SuperUser_Rank@1x.png Proud to be a Super User.
If I helped, please accept the solution and give kudos
Linkedin

 

jonnyA
Responsive Resident
Responsive Resident

@lkalawski , Thank you so much, high five, that worked!!!

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.