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

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

Reply
Anonymous
Not applicable

Measure

i have my data as follows

Case NumberProcedure code
1505SN21
1505SN21
1505SN23
1508SN21
1508MR28
1509SN21
1510MR28
1511SN23
1512SN23
1509SN21
1513SN21
1513SN21


I am trying to create a measure that counts unique "CaseNumbers" that are carrying "SN21" procedure Code.

(or)

Count of CaseNumbers that has SN21 procedure code repeated twice. 

2 ACCEPTED SOLUTIONS
Fowmy
Super User
Super User

@Anonymous 

You can use this measure:

Unique Case Numbers = 

CALCULATE(
    DISTINCTCOUNT(Table[Case Number]),
    Table[Procedure code] = "SN21" 
)
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

@Anonymous 

Try this:

Unique Case Numbers = 
CALCULATE(
    COUNT(Table2[Case Number]),
    Table2[Procedure code] = "SN21" 
)
-
CALCULATE(
    DISTINCTCOUNT(Table2[Case Number]),
    Table2[Procedure code] = "SN21" 
)
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

3 REPLIES 3
Fowmy
Super User
Super User

@Anonymous 

You can use this measure:

Unique Case Numbers = 

CALCULATE(
    DISTINCTCOUNT(Table[Case Number]),
    Table[Procedure code] = "SN21" 
)
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

Is there any way to use this expression to subract the SN21 procedure total count - SN21 procedure distinct ocunt!!

@Anonymous 

Try this:

Unique Case Numbers = 
CALCULATE(
    COUNT(Table2[Case Number]),
    Table2[Procedure code] = "SN21" 
)
-
CALCULATE(
    DISTINCTCOUNT(Table2[Case Number]),
    Table2[Procedure code] = "SN21" 
)
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

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.

Top Kudoed Authors