Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi All,
What is wrong with this formular?
I am trying to assign the shift type, but it gives me the error:
Solved! Go to Solution.
Maybe try this.
Shift 2 =
VAR _Date = SELECTEDVALUE( P259_tblJobs[CrewDttm] )
VAR _WkDay = WEEKDAY( _Date, 2 )
VAR _StartTime = SELECTEDVALUE( P259_tblJobs[Start Time] )
VAR _Result =
IF(
_WkDay > 5,
"Weekend",
IF(
_WkDay <= 5
&& _StartTime >= 6 / 24
&& _StartTime <= 14 / 24,
"Day",
IF(
_WkDay <= 5
&& _StartTime >= 14 / 24
&& _StartTime <= 22 / 24,
"Afternoon",
"Night"
)
)
)
RETURN
_Result
Let me know if you have any questions.
Maybe try this.
Shift 2 =
VAR _Date = SELECTEDVALUE( P259_tblJobs[CrewDttm] )
VAR _WkDay = WEEKDAY( _Date, 2 )
VAR _StartTime = SELECTEDVALUE( P259_tblJobs[Start Time] )
VAR _Result =
IF(
_WkDay > 5,
"Weekend",
IF(
_WkDay <= 5
&& _StartTime >= 6 / 24
&& _StartTime <= 14 / 24,
"Day",
IF(
_WkDay <= 5
&& _StartTime >= 14 / 24
&& _StartTime <= 22 / 24,
"Afternoon",
"Night"
)
)
)
RETURN
_Result
Let me know if you have any questions.
thanks for the solution, much appreciated!
However, this has aslo created multiple duplicated lines across the entire table 😞
Hi @KatrinaG
Can you replicate the problem using test data?
I really can't think of any reason for the duplicates. (It's the same as your DAX but with a few minor changes and it seems to work in my example.)
Thanks for the advice, I've actualy found the saurce of the problem. It is driven by notes from tblJobs-Custom, but I still need this column as there is one conditional columns linked to it.
How can I forward you the sample?
Thanks again!
Attaching the snap shot of the refence data in the table:
User | Count |
---|---|
94 | |
77 | |
71 | |
62 | |
58 |
User | Count |
---|---|
110 | |
103 | |
84 | |
65 | |
62 |