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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Count of members currently admitted using a dim_date table and a fac_member table

I have Member_ID, Admit_Date, and Discharge_Date from a fact table and a CalendarDate from a Dim_Date table.

 

I am using CalendarDate as the axis on a line graph and want to show the number of members who were currently admitted on each date...meaning the calendar date was between the Admit_Date and Discharge_Date.

 

This is what I did for the measure, but I don't think it is right.

 

Currently_Admitted_Measure= CALCULATE(DISTINCTCOUNT(Fac_Member[Member_ID]),FILTER(Dim_Date,Dim_Date[CalendarDate]>MAX(Fac_Member[Admit_Date])),FILTER(Dim_Date,Dim_Date[CalendarDate]<MAX(Fac_Member[Discharge_Date])))
 
Any help is much appreciated! Thanks!
2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@Anonymous ,

 

You may refer to the post below.

https://community.powerbi.com/t5/Desktop/Create-date-Parameter-asat-date-to-get-active-customers/m-p/311306#M137927

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi,

 

Thanks! This gives me the counts I am looking for! Instead of COUNTROWS, is there something else I can use to also identify the associated Member_ID's as well?

 

Thanks in Advance,

 

Ronald

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.