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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
elinevans
Helper I
Helper I

Number of activities in a dynamic date range

I have a calendar table which is diplayed as a slicer on the report - so the user can choose the reporting period. 

 

I also have data as the follows:

Activtiy Table

Date of ActivityActivity referenceClient reference
01/02/20221234598765
05/06/20221235689576
06/07/20221235898765
02/01/20221234645869
01/04/20221234945869
03/01/20221234847589
12/02/20221235747589

 

Client table

Client ReferenceService Start DateService End Date
9876512/12/202105/08/2022
8957602/02/202207/07/2022
4586901/01/2022-
4758924/12/202102/03/2022

A relationship would exsist betweent he client reference on the client table and the client reference on the activtity table. 

 

I want to see how many clients started service in the reporting period (date range selected in slicer) had no activties, 1 activity, or more than one activtiy also in the reporting period. So need to count how many activties each client has had in the reporting period. Categorise each client into a group 'No activity', '1activity','More than one activity', and then filter it down to only include client with a startdate inbetween the start and end date of the date range. So I end up with a table visual like the following:

 

 

EDIT: So that expected result is based on data provided. Assume that my reporting period is 15/12/2021-30/03/2022. Client ref 98765 would not be included in the count as their service does not start within the reporting period. When counting the activties of the other clients, client 89576 would come into the 'No Activities' as although they have 1 activtiy recorded this activtiy does not fall in the reporting period. Client 45869 would fall in the '1 activtiy' category as it has only 1 activity logged within the reporting period, and client 47589 will fall into the 'more than one activtity category' as they have more than 1 activtiy logged in the reporting period. 

No. Activities in the reporting period for clients who started in the reporting period

Activties Number of clients
No Activities1

1 Activty

1
More than one activity1

 

I've tried calculated columns and summaried tables but I can't filter these dynamically using the date slicer

 

 

Thanks in advance

 

3 REPLIES 3
lbendlin
Super User
Super User

Your sample data is inconsistent with the expected result. 

 

Please provide sanitized sample data that fully covers your issue. 
Please show the expected outcome based on the sample data you provided

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Hi @lbendlin 

 

Apologies, 

 

I have amended the post. Hopefully this has gioven you more info?

 

Thanks

 

You got me confused with your criteria, especially this one

"Client ref 98765 would not be included in the count as their service does not start within the reporting period. "

 

Anyway, here's what I have so far but it totally doesn't match with your expectations (because I don't understand them)

lbendlin_0-1659991792171.png

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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