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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! 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
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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