The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
Solved! Go to Solution.
@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])
@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])
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.
User | Count |
---|---|
25 | |
12 | |
8 | |
8 | |
7 |
User | Count |
---|---|
28 | |
13 | |
12 | |
12 | |
6 |