Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
I need to develop a visual to show the number of patients admitted compared to the number of patients discharged by month, year. I have the admission and discharge dates in the same table, and currently this is connected to a separate Date Table using the discharge date. The issue I'm having is with the date table that drives the months. How do I show two different date ranges in one chart? For example 500 people can admit on Jan 5, and 450 people can discharge on Jan 5 - each set has unique dates.
Sample Data
I tried separating the Admission data into a unique table and connecting that to the Date tabel using the Admission date, but It didn't help.
I considered not using a Date Table, but then I'm still stuck with the date issue since I need to have one for the visual.
Thank you.
Solved! Go to Solution.
Hi,
Create a non-active relationship (Many to One and Single) from the Admission date to the Date column of the Calendar Table. To your visual, drag Year and Month name from the Calendar Table. Write these measures
Discharged = distinctcount(Data[Patient ID])
Admitted = calculate([discharged],userelationship(Data[Admission date],Calendar[date]))
Hope this helps.
Hi,
Create a non-active relationship (Many to One and Single) from the Admission date to the Date column of the Calendar Table. To your visual, drag Year and Month name from the Calendar Table. Write these measures
Discharged = distinctcount(Data[Patient ID])
Admitted = calculate([discharged],userelationship(Data[Admission date],Calendar[date]))
Hope this helps.
Hi Ashish,
I appreciate the assistance.
When creating the Admitted measure, I'm getting the followng error: USERELATIONSHIP function can only use the two columns references participating in relationship.
I got it. Needed to remove [Date] from the compelte date.
Thank you!
You are welcome.
@jenniferrayner , I think you should consider date table with Active/Inactive join here and create meausre using userelationship
consider
Power BI: HR Analytics - Employees as on Date : https://youtu.be/e6Y-l_JtCq4
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 42 | |
| 37 | |
| 34 | |
| 21 | |
| 16 |
| User | Count |
|---|---|
| 65 | |
| 62 | |
| 31 | |
| 26 | |
| 25 |