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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
navneet0512
Helper III
Helper III

Switch statement issues

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, "Late 6-10 Days",
[Actual Working Day] <= -3, "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"


)
navneet0512_0-1694530804920.png

 

17 REPLIES 17
parry2k
Super User
Super 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!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super 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.

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

As I am using calcualted measure only so I am surpried . 

navneet0512_0-1694578522100.png

 

navneet0512
Helper III
Helper 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 .
navneet0512_0-1694575085460.png

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")
parry2k
Super User
Super User

@navneet0512 In Actual Working Days column what is the GLMLTT, column or a measure?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

GLMLLT is column in table and working day num is calulated column .

parry2k
Super User
Super User

I asked two questions. Can you take a moment to answer both?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Both are calculated column :- 

navneet0512_0-1694538320476.png

 

parry2k
Super User
Super 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


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Calcualted Column it is..

navneet0512_0-1694537883188.png

 

Kishore_KVN
Super User
Super User

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!!

What is the different in my statement and your? all are same 

No for -6 and -3 defined outer limits as well

navneet0512_0-1694533840643.png

Still facing same issues

Can you show what is the data type of that measure you have created which is Actual Working Day. Also please share its calculation if possbile. 

navneet0512_0-1694535689831.png

 

navneet0512_0-1694532651306.png

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, "Late 6-10 Days",
[Actual Working Day] <= -3, "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"


)

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.