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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Memorable Member
Memorable Member

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
Memorable Member
Memorable Member

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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