Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi Guys, i'm hoping that you can help me out here and potentially advise on some best practices too. I'm brand new to Power BI/M/DAX and relatively new to SQL so my ambition far exceeds my skillset currently!
i've got three tables; an extract from a SQL server which is connected to a dimension table on the received date, and an SLA table connected to the extract based on an urgency. Relationships shown below nb. the inactive relationship between dim_date and the Closed date field also;
Based on the Received Date and Time in the extract, i'm trying to calculate the next working day from dim_date. For example, if the received time is before the start of the working day, then that day is the next working day. However, if it is received after 5pm or on a weekend then the next working day would be the following morning.
To assist, there is a field in Dim_Date for [IsHolidayUK] and [IsWeekday] as (true/false), and [StartDate] in the extract which defaults to 09:00 if outside normal working hours so i'm guessing that i need a subquery to filter out those holiday and weekend dates somehow?
Any advise or help would be greatly appreciated, and thanks in advance!
Solved! Go to Solution.
As i was typing, i think i resolved it;
NextWorkingDay =
minx(
FILTER(
ALL(Dim_Date), Dim_Date[IsWeekday] = TRUE &&
Dim_Date[IsHolidayUK] = FALSE &&
Dim_Date[Date] > SELECTEDVALUE('SysAid Extract'[ReceivedDate])
),Dim_Date[Date])
This looks to be doing what i need for the moment so i may well have answered my own query.
I love it when a plan comes together...
As i was typing, i think i resolved it;
NextWorkingDay =
minx(
FILTER(
ALL(Dim_Date), Dim_Date[IsWeekday] = TRUE &&
Dim_Date[IsHolidayUK] = FALSE &&
Dim_Date[Date] > SELECTEDVALUE('SysAid Extract'[ReceivedDate])
),Dim_Date[Date])
This looks to be doing what i need for the moment so i may well have answered my own query.
I love it when a plan comes together...
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
100 | |
54 | |
21 | |
12 | |
11 |