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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Dynamic Date Range

Hi guys,

 

I have got some HR data and would like to see the number of active employees at any given date range ([SelectionDate]) and visualise them in a column chart with x axis being the date range. For example, if the [SelectionDate] is less than termination date[TermDate] and greater than hire date [HireDate], a count of 1 should be displayed in the column chart against that date.

 

I have given it a try but cannot achieve what I wanted. I basically want a time series of number of active employees but the dataset only has the latest data. I dont know if this requires date parameter? Please see links to the dummy dataset and pbi file.

 

PBI:

https://drive.google.com/file/d/1-9AVevN06C-k6Wz6DAmEerqMRHb85W34/view?usp=sharing

 

Dataset:

https://docs.google.com/spreadsheets/d/1QcMt7CZJ8F_jiMVnGZGWaA1qpx69h1n5/edit?usp=sharing&ouid=11750... 

 

Any help or pointers would be appreciated!

 

Cheers

 

kenakee405_2-1642990394466.png

 

kenakee405_1-1642990187717.png

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Anonymous ,

 

Please try:

ActiveInd = 
VAR _T=FILTER('DataTable',[HireDate]<=MAX('SelectionDates'[SelectionDateRange]) && [TermDate]>=MAX('SelectionDates'[SelectionDateRange]))
RETURN COUNTROWS(_T)

Eyelyn9_0-1643248628201.png

Best Regards,
Eyelyn Qin
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
Anonymous
Not applicable

Hi  @Anonymous ,

 

Please try:

ActiveInd = 
VAR _T=FILTER('DataTable',[HireDate]<=MAX('SelectionDates'[SelectionDateRange]) && [TermDate]>=MAX('SelectionDates'[SelectionDateRange]))
RETURN COUNTROWS(_T)

Eyelyn9_0-1643248628201.png

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

Ashish_Mathur
Super User
Super User

Hi,

I can probably help if you select a specific month/range of months rather than a specific date/date range (as you have shown in your visual)?  Will that be acceptable to you?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors