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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.

Top Solution Authors