Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I am building a production schedule and am trying to set up shifts to plan production or not. I used the below FILTER to designate production between 6am and 10pm on weekdays. For another equipment center, I'd like to setup a shift that doesn't operate past 2pm on Fridays (they run a 4/10 schedule). Could someone help me combine the WEEKDAY and TIME filters to account for this?
var _table =
TOPN(
hours + 1,
FILTER(
'Production Gantt',
'Production Gantt'[Value] > firststartdate &&
('Production Gantt'[Value] - INT('Production Gantt'[Value])) > TIME(6,0,0) &&
('Production Gantt'[Value] - INT('Production Gantt'[Value])) < TIME(22,0,0) &&
WEEKDAY('Production Gantt'[Value])<>1 &&
WEEKDAY('Production Gantt'[Value])<>7
),
[Value],
ASC
) return //schedule from 6am through 10pm start times on weekdays.
@krwalke , Not very clear. Are you looking for business hours?
https://exceleratorbi.com.au/calculating-business-hours-using-dax/
The information you have provided is not making the problem clear to me. Can you please explain with an example.
Appreciate your Kudos.
The above FILTER code is written and filters another date table ('Production Gantt' - generated list of dates for the next 365 days in units of minutes) by the following:
- time is greater than 6am
- time is less than 10pm
- the day is not Sunday
- the day is not Saturday
What I'm looking to add to that is:
- the day is not Friday after 2pm
Thanks for the reply and help!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 64 | |
| 32 | |
| 31 | |
| 27 |