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
BM4291
Resolver I
Resolver I

Counting number of occurrences in a year/period

Hi,

 

I have is a list of people and a start/end date for them on a table, it looks a little like the below, people can appear on the table multiple times and date periods can overlap: 

 

180810 PBI Example Table.png

 

What I need to be able to do is say how many people were around in a given period i.e. financial year (1st Apr -  31st Mar). Given the above if I were to do a count of people for 2015-16 I would expect to see 3, if I did a count for 2016-17 I would expect to see 1.

 

My base measure is: people = DISTINCTCOUNT(Table[ID]).

 

It feels like there should be an easy way to do this with a DATESBETWEEN or FILTER but I keep missing it; the 'Start' column is currently in a relationship (one-way) with my Dates table but this is then only counting people in the year that they start so Joe Bloggs in the above would only count in 2015-16 when he should also be counted in 2016-17.

 

Hopefully the above makes sense, I have a feeling I need to delete the relationship and try something else with the start and end points of the financial years?

1 ACCEPTED SOLUTION
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @BM4291,

 

You could refer to this similar thread which should help you.

 

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @BM4291,

 

You could refer to this similar thread which should help you.

 

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks, this is along the lines of what I was trying to get at... I think I was just a bit tired towards the end of a Friday in the office and was missing the obvious!!

 

Really helpful links, will share with my team.

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.