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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Filter out the Date by certain number of days

Hello, 

 

I have a data table with employee start day and end date. I would like to create a visual that can bucket both start/end day by next 7/14/21 days with a reference to today. For example, if there is one employee with last day of 2/5/2022, I would be able to get the right number. I tried the following DAX, and this formula did not correctly bucket the number in the correct category. The following Dax measure counted the same employee for Start 14, Start 21. If the start date is 2/5, I would only want a count of 1 in Start 14 day category.

CALCULATE(count('Agency Weekly Update'[ID 2]),'Agency Weekly Update'[StartDate]>today(),'Agency Weekly Update'[StartDate]<= TODAY()+7)

 

 Start 7 Start 14Start 21
A1  
B 2 
C   

 

Thank you so much!

 

2 REPLIES 2
v-rongtiep-msft
Community Support
Community Support

Hi @Anonymous ,

Your expression is not very clear. I'm not sure what you want to get out of it. start_7 is your data available or calculated.

If there is one employee with last day of 2/5/2022, what is  the right number you got? 

 

If it is possible, please provide your pbix without privacy ingormation and desired output.

 

Best Regards

Community Support Team _ Polly

 

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

amitchandak
Super User
Super User

@Anonymous , Not very clear, you want 0-7 days, 7 to  14 days? or 0-14 days

 

0-7

CALCULATE(count('Agency Weekly Update'[ID 2]),filter('Agency Weekly Update',  'Agency Weekly Update'[StartDate]>today(),'Agency Weekly Update'[StartDate]<= TODAY()+7) )

 

0-14

CALCULATE(count('Agency Weekly Update'[ID 2]),filter('Agency Weekly Update',  'Agency Weekly Update'[StartDate]>today(),'Agency Weekly Update'[StartDate]<= TODAY()+14) )

 

7-14

CALCULATE(count('Agency Weekly Update'[ID 2]),filter('Agency Weekly Update',  'Agency Weekly Update'[StartDate]>today()+7,'Agency Weekly Update'[StartDate]<= TODAY()+14) )

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors