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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
adricrist87
Regular Visitor

Show the number of patients with 2+ visits per day.

Hello, hope you can help me with this one.

 

I am trying to build a measure to show when the same Patient ID has been scheduled for 2+ appointments on the same day. I want to be able to use this measure to show how often this occurs per day/month year etc.

 

I've looked everywhere and tried many approaches but can't figure it out 😞

 

I have these 3 columns:

Appt Date/Time

Patient ID

Patient Name

 

Thank you in advance.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@adricrist87 , Create a date if you have datetime as a new column

 

date = datevalues([Appt Date/Time] )

 

Countx(filter(summarize(Table, Table[Date], Table[Patient ID], "_1", countrows(Table) ) , [_1] >1), [Patient ID])

 

or

 

measure =

var _tab =

filter(summarize(Table, Table[Date], Table[Patient ID], "_1", countrows(Table) ) , [_1] >1)

return

countx(summarize(_tab, [Patient ID]), [Patient ID])

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@adricrist87 , Create a date if you have datetime as a new column

 

date = datevalues([Appt Date/Time] )

 

Countx(filter(summarize(Table, Table[Date], Table[Patient ID], "_1", countrows(Table) ) , [_1] >1), [Patient ID])

 

or

 

measure =

var _tab =

filter(summarize(Table, Table[Date], Table[Patient ID], "_1", countrows(Table) ) , [_1] >1)

return

countx(summarize(_tab, [Patient ID]), [Patient ID])

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you so much for your prompt response. I followed the first option with measure:

 

Countx(filter(summarize(Table, Table[Date], Table[Patient ID], "_1", countrows(Table) ) , [_1] >1), [Patient ID])

 

Based on the results in the table below 135 Patient IDs had 2 or more appointments scheduled for 01/03/2022, 153 for 01/04/2022, and so on?

 

Thank you.

 

adricrist87_1-1651849072351.png

 

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.