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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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])

 

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])

 

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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