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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join 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
Fabric Data Days is here Carousel

Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

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.