Forum Discussion
Switch statement issues
17 Replies
- Kishore_KVNSolution Sage
Hello navneet0512 ,
Please use below calculation it may work for you:
ACTUAL WORKING DAYS PERFORMANCE = SWITCH (True(),--[Actual Working Days] = blank(), "null",[Actual Working Day] < -19 , "Late 20+ days",([Actual Working Day] <= -11 && [Actual Working Day] > -19 ), "Late 11-19 Days",([Actual Working Day] <= -6 && [Actual Working Day] > -11), "Late 6-10 Days",([Actual Working Day] <= -3 && [Actual Working Day] > -6), "Late 3-5 Days",[Actual Working Day] <= -1 , "Late 1-2 Days",[Actual Working Day] = 0, "OnTime",([Actual Working Day] >= 1 && [Actual Working Day] <= 2), "Early 1-2 Days",([Actual Working Day] >= 3 &&[Actual Working Day] <= 5), "Early 3-5 Days",([Actual Working Day] >= 6 && [Actual Working Day] <= 10), "Early 6-10 Days",([Actual Working Day] <= 11 && [Actual Working Day] <= 19), "Early 11-19 Days",[Actual Working Day] > 19 , "Early 20+ Days", "Unknown"If this post helps, then please consider accepting it as the solution to help other members find it more quickly. Thank You!!- navneet0512Helper III
What is the different in my statement and your? all are same
- Kishore_KVNSolution Sage
No for -6 and -3 defined outer limits as well
- parry2kSuper User
navneet0512 answer this:
- Is this a measure or a column: Actual Working Days
- Are you adding this as a calculated column or a measure: ACTUAL WORKING DAYS PERFORMANCE- navneet0512Helper III
Calcualted Column it is..
- parry2kSuper User
I asked two questions. Can you take a moment to answer both?
- navneet0512Helper III
Both are calculated column :-
- parry2kSuper User
navneet0512 In Actual Working Days column what is the GLMLTT, column or a measure?
- navneet0512Helper III
GLMLLT is column in table and working day num is calulated column .
- navneet0512Helper III
Bucket is not allined with actual working days :-
Actual working day is calcualted column .
Actual working days :- X-Networkingdays here x is also a column from same table and networking day is calculated column .ACTUAL WORKING DAYS PERFORMANCECommunity = SWITCH (True(),--[Actual Working Days] = blank(), "null",[Actual Working Day] <= -20 , "Late 20+ days",([Actual Working Day] < -10 && [Actual Working Day] > -20 ), "Late 11-19 Days",([Actual Working Day] <= -6 && [Actual Working Day] > -11), "Late 6-10 Days",([Actual Working Day] <= -3 && [Actual Working Day] > -6), "Late 3-5 Days",[Actual Working Day] <= -1 , "Late 1-2 Days",[Actual Working Day] = 0, "OnTime",([Actual Working Day] >= 1 && [Actual Working Day] <= 2), "Early 1-2 Days",([Actual Working Day] >= 3 && [Actual Working Day] <= 5), "Early 3-5 Days",([Actual Working Day] >= 6 && [Actual Working Day] <= 10), "Early 6-10 Days",([Actual Working Day] >= 11 && [Actual Working Day] <= 19), "Early 11-19 Days",[Actual Working Day] >= 20 , "Early 20+ Days", "Unknown") - parry2kSuper User
navneet0512 I could be wrong but I have a feeling that you are mixing up measures and columns (calculated columns). I would recommend sharing a pbix file with the sample data using one drive/google drive and removing any sensitive information before sharing.
- navneet0512Helper III
As I am using calcualted measure only so I am surpried .
- parry2kSuper User
Thanks for adding more confusion. As in my previous reply I asked for pbix file, if you cannot provide one then I have no idea how to assist. I hope someone else will able to help. Good luck!