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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. 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
Resident Rockstar
Resident Rockstar

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
Resident Rockstar
Resident Rockstar

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.