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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
adoster
Resolver I
Resolver I

DAX - Distinct count of Patients, per Day, per Provider

I have built a statement to count the distinct number of Patients seen in a day.

 

PatientDistinctByDate =
var tmptable =
SUMMARIZE('Dates','Dates'[Date], "DistinctCount",DISTINCTCOUNT('All Data'[PAT_ID]))
RETURN SUMX(FILTER(tmptable,[Date]<= MAX('Dates'[Date])),[DISTINCTCOUNT])

 

I am having difficulty adding to this statement so that if they saw a different Provider(s) in the same day it will count that patient again.

 

Example...

IF John Smith saw Dr. Acula twice on 4/5/23 = 1 count

IF John Smith saw Dr. Acula twice & Dr. Zebra on 4/6/23 = 2 count

IF John Smith saw Dr. Acula, Dr. Zebra, & Dr. House twice on 4/7/23 = 3 count

 

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@adoster 

I have someting similar in my model.  I utilize the Claims table to get the [Visit Count].

Visit Count =
COUNTROWS (
    SUMMARIZE (
        CLAIM,
        CLAIM[Subscriber_Member_ID],
        CLAIM[Service_Date],
        CLAIM[Provider_ID]
    )
)

View solution in original post

2 REPLIES 2
jdbuchanan71
Super User
Super User

@adoster 

I have someting similar in my model.  I utilize the Claims table to get the [Visit Count].

Visit Count =
COUNTROWS (
    SUMMARIZE (
        CLAIM,
        CLAIM[Subscriber_Member_ID],
        CLAIM[Service_Date],
        CLAIM[Provider_ID]
    )
)
DOLEARY85
Super User
Super User

Hi,

 

try this:

 

Measure 3 = CALCULATE(DISTINCTCOUNT('Table'[Doctor]),ALLEXCEPT('Table','Table'[Doctor],'Table'[Date]))
 
data provided (left) after measure (right): 
DOLEARY85_1-1680805142996.png

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍


 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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