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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.