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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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