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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
cyberblitz
Helper II
Helper II

COUNT USING 2 DIFFERENT DATES

I have a data table and calendar table.

 

The data table contains two dates: admission date and discharge date. (the admission date and dishcarge date may not be in the same month)

 

I have created a relationship from the key column in the calender to the admission date column in the data table, and a inactive realtionship to the discharge date column.

 

I need to be able to count how many admissions and dishcarges there were for each month/year and display this in a graph.

 

I have scoured the net forhours to find a sotuoin to this to no avail.

6 REPLIES 6
cyberblitz
Helper II
Helper II

SUre: https://www.dropbox.com/s/fd2igf82ilirke4/Occuapancy%20-%20Copy.pbix?dl=0

 

I also want to be able to show hourly admissions and discharghes in a chart below too. But when i though i had this working, the cross filtereing does not work at all

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

Hi,

Do these measures work?

Admissions = distincountcount(data[Admn number])

Dicharges = calculate([admissions],userelationship(data[discharge date],calendar[date]))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur @amitchandak I have tried:

Admissions = distincountcount(data[Admn number])

Dicharges = calculate([admissions],userelationship(data[discharge date],calendar[date]))

 

But all i get is the exact same number count for admission and discharge

Hi,

Share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

@cyberblitz , For admission it just count or distinctcount of admission id. For discharge, you need to use userelation to use the discharge date.

refer example : https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

 

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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