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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.