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

View all the Fabric Data Days sessions on demand. View schedule

Reply
cia61
New Member

Working with Dates

I have to report which Labor periods the data captured falls within.  So instead of using just the calendar month to filter data, I have to use time periods that cross calendar months.   I can use a DAX equation like the one below but it seems like If I used a "Labor Dates table (see below) and create a relationship to the time entered data I could do this more efficiently.

 

Dax Equation

YTD Labor = if('Akron Cyient Submitted Timeshee'[Work Date].[Date] >= DATE(2021,1,4) && 'Akron Cyient Submitted Timeshee'[Work Date].[Date] <= DATE(2021,1,31) ,"January",
                if('Akron Cyient Submitted Timeshee'[Work Date].[Date] >= DATE(2021,2,1) && 'Akron Cyient Submitted Timeshee'[Work Date].[Date] <= DATE(2021,2,28) ,"February",
                if('Akron Cyient Submitted Timeshee'[Work Date].[Date] >= DATE(2021,3,1) && 'Akron Cyient Submitted Timeshee'[Work Date].[Date] <= DATE(2021,3,28) ,"March",
                if('Akron Cyient Submitted Timeshee'[Work Date].[Date] >= DATE(2021,3,29) && 'Akron Cyient Submitted Timeshee'[Work Date].[Date] <= DATE(2021,5,2) ,"April",
                if('Akron Cyient Submitted Timeshee'[Work Date].[Date] >= DATE(2021,5,3) && 'Akron Cyient Submitted Timeshee'[Work Date].[Date] <= DATE(2021,5,30) ,"May",
                if('Akron Cyient Submitted Timeshee'[Work Date].[Date] >= DATE(2021,5,31) && 'Akron Cyient Submitted Timeshee'[Work Date].[Date] <= DATE(2021,6,27) ,"June",
                if('Akron Cyient Submitted Timeshee'[Work Date].[Date] >= DATE(2021,6,28) && 'Akron Cyient Submitted Timeshee'[Work Date].[Date] <= DATE(2021,8,1) ,"July",
                if('Akron Cyient Submitted Timeshee'[Work Date].[Date] >= DATE(2021,8,2) && 'Akron Cyient Submitted Timeshee'[Work Date].[Date] <= DATE(2021,8,29) ,"August",
                if('Akron Cyient Submitted Timeshee'[Work Date].[Date] >= DATE(2021,8,30) && 'Akron Cyient Submitted Timeshee'[Work Date].[Date] <= DATE(2021,9,26) ,"September",
                if('Akron Cyient Submitted Timeshee'[Work Date].[Date] >= DATE(2021,9,27) && 'Akron Cyient Submitted Timeshee'[Work Date].[Date] <= DATE(2021,10,31) ,"October",
                if('Akron Cyient Submitted Timeshee'[Work Date].[Date] >= DATE(2021,11,1) && 'Akron Cyient Submitted Timeshee'[Work Date].[Date] <= DATE(2021,11,28) ,"November",
                if('Akron Cyient Submitted Timeshee'[Work Date].[Date] >= DATE(2021,11,29) && 'Akron Cyient Submitted Timeshee'[Work Date].[Date] <= DATE(2022,1,1) ,"December","NA"))))))))))))
 
Labor Table
 
cia61_0-1628256185742.png

 

2 REPLIES 2
amitchandak
Super User
Super User

@cia61 ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

refer if this can help

How to divide/distribute values between start date or end date or count days across months/days: https://community.powerbi.com/t5/Community-Blog/How-to-divide-distribute-values-between-start-date-o...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Although this points me in a direction I am having a hard time correlating this solution with the solution I need. 

 

How do I upload sample data?

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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
Top Kudoed Authors