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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
petermb72
Helper III
Helper III

line graphs based on data with two dates

We are a healthcare facility and we are looking for tracking the number of people through the facility.  To get that we take the total number of people in the facility on the first of the month and then add all the admissions for the month to the total that we had on the first.  I want to be able to present the data from month to month in a line graph or a bar chart.  Here is what a sample of the data looks like:

Resident NumberCensus DateAdmission DateNotes:
12341/1/202310/5/2022count 1st of month
11111/1/2023

12/15/2022

count 1st of month

12341/2/202310/5/2022don't count
55551/2/20231/2/2023count new admit
11111/2/202312/15/2022don't count
12341/3/202310/5/2022don't count
55551/3/20231/2/2023don't count
11111/3/202312/15/2023don't count
12341/4/202310/5/2022don't count
55551/4/20231/2/2023don't count
78911/5/20231/5/2023count new admit
12341/5/202310/5/2022don't count
55551/5/20231/2/2023don't count
78911/30/20231/5/2023don't count
12341/30/202310/5/2023don't count
55551/30/20231/2/2023don't count

With the above sample we would have a total number of residents through the facility of 4 (two residents present on the 1st and then two new admits)for January.  This data would continue will all of the days of the year in the file.   Any help on how to get the number of residents on the 1st plus the number of residents admitted durring that month and then presenting it as a graph of month to month for the year, that would be awesome.

 

Peter

2 REPLIES 2
v-yangliu-msft
Community Support
Community Support

Hi  @petermb72 ,

 

Here are the steps you can follow:

1. Create measure.

Measure =
CALCULATE(DISTINCTCOUNT('Table'[Resident Number]),
    FILTER(ALL('Table'),
    YEAR('Table'[Census Date])=YEAR(MAX('Table'[Census Date]))&&MONTH('Table'[Census Date])=MONTH(MAX('Table'[Census Date]))&&
   'Table'[Census Date]=EOMONTH(MAX('Table'[Census Date]),-1)+1 ||
    'Table'[Census Date]='Table'[Admission Date])
)

2. Result:

vyangliumsft_0-1704080760043.png

 

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

lbendlin
Super User
Super User

would a graphical solution help?

 

lbendlin_0-1703972444450.png

Any help on how to get the number of residents on the 1st plus the number of residents admitted durring that month and then presenting it as a graph of month to month for the year, that would be awesome.

Your sample data is insufficient for this.

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.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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