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

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.

Reply
CoreyP
Solution Sage
Solution Sage

HELP; I'm stuck! Adding ONLY working days??

Hello Power BI Gurus!! 

 

I'm reaching out for a little nudge in the right direction from your never-ending collection of knowledge! I've tried googling and youtubing for days now trying to come up with a solution. Maybe I found the solution and lacked the requisite knowledge to understand it completely? I'm not sure, but I would greatly appreciate any advice you all could give. Thank you for your time and effort, in advance. 

 

The Context:

I am trying to create a KPI report for order fulfillment. At the moment, I'm wanting to determine what our ship by deadline must be for a huge range of orders. So, depending on the type of the order, we either have 1 or 3 consecutive working days to ship the order. 

 

The Problem:

I have a fact table full of order information. What I want is a calculated column that adds either 1 day or 3 days to the Order Rcv Date depending on whether it's a retail order or a wholesale order. So, I have a conditional column that returns a 1 if it's retail, and a 3 if it's wholesale. The problem is, they must be working days, eg. Monday - Friday. (Note: My weeks are currently option 2, 1mon-7sun) So, If a retail order is received on a friday, if we add 1 it equals Saturday, so we must add 3 to make it Monday. If a wholesale order is received on a thursday, for example, and I add 3, it lands on Sunday, but it's supposed to be that following Tuesday. 

 

Where I'm at now:

I have my fact table, my orders table. I also have a custom date dimension table with fiscal and week ending and quarters and everything you could think of. I also have a column that returns a 1 if it's a workday (a non-weekend and non-holiday), and a 0 if it's a weekend or holiday. I have a relationship between the two tables. I'm just not sure what function I can use in my calculated column for my fact table to complete this. Do I just write a long, nesting, IF formula that basically says "if order rcv date plus one is saturday, add 3, etc. etc.?? 

 

So, yeah, that's it. Any wisdom y'all can bestow upon me, I'd be forever grateful. Thanks, guys!

 

ORDER TABLE EXAMPLE DATA:

Ord Rcv Date        Order Received Time        Order Type       Order Type Deadline             must Ship By

3/2/20184:07:24 PMRetail1 
3/2/20186:52:56 AMRetail1 
3/2/20183:29:31 PMRetail1 
3/2/20183:54:57 PMRetail1 
3/2/20182:38:27 PMWholesale3 
3/2/20182:40:48 PMWholesale3 
3/2/20184:09:26 AMRetail1 
3/2/20186:09:33 AMRetail1 
3/2/20186:23:53 AMRetail1 
3/2/20186:29:58 AMRetail1 
3/2/20186:42:22 AMRetail1 
3/2/20189:19:47 AMRetail1 
3/2/201810:32:28 AMRetail1 
3/2/201811:21:45 AMRetail1 
3/2/201811:23:50 AMRetail1 
3/2/20181:29:26 PMRetail1 
3/2/20183:27:27 PMRetail1 
3/2/201810:30:14 AMRetail1 
3/2/20188:51:28 AMRetail1 
3/2/20189:28:10 AMRetail1 
3/2/20189:57:43 AMRetail1 
3/2/20183:29:34 PMRetail1 
3/2/201811:30:14 AMWholesale3 
3/2/20183:49:10 AMRetail1 
3/2/20184:07:17 AMRetail1 
3/2/201812:08:35 PMRetail1 
3/2/201812:44:51 PMRetail1 
3/2/201810:32:31 AMWholesale3 
3/2/20186:07:03 AMRetail1 
3/2/20185:22:03 PMRetail1 
3/5/20188:28:29 AMRetail1 
3/5/20188:30:32 AMRetail1 
3/5/20189:03:48 AMRetail1 
3/5/201812:11:40 PMRetail1 
3/5/20183:16:20 PMWholesale3 
3/5/20189:35:10 AMRetail1 
3/5/201810:58:38 AMRetail1 
3/5/201811:15:17 AMRetail1 
3/5/201812:26:06 PMRetail1 
3/5/20184:07:46 PMRetail1 
3/5/20184:28:33 PMRetail1 
3/5/20187:45:04 PMRetail1 
3/5/20186:02:54 AMRetail1 
1 ACCEPTED SOLUTION

Hey guys!! 

 

I finally got a solution to this cRaZy problem!! It was solved in another thread I posted. It can be viewed here:

 

http://community.powerbi.com/t5/Desktop/Possibly-Maybe-a-Lookup-or-something-Check-out-what-I-m-tryi...

View solution in original post

21 REPLIES 21

***UPDATE 1:18PM***

 

I JUST GOT IT TO WORK! BOOYAH!

 

For my Order Rcv Date, I had been referencing a conditional column I had previously created to account for orders that dropped on the weekend, and would change it to the following monday, this was called my "Corrected Ord Rcv Date."

 

I just thought that might be causing issues because my TEST4 column also has rules for if the Rcv Date falls on a weekend, so it was like double condition or something. So, I just changed my TEST4 column reference to the actual Order Received Date, and then I changed my TEST4 Validation column ..

 

FROM:

TEST4 validation = FORMAT(WEEKDAY(BARRE3[TEST4], 2), "DDDD")

TO:

 

TEST4 validation = FORMAT(BARRE3[TEST4], "DDDD")

 

...AAAnnnnnd, whaddya know?! I don't get a single weekend date in my TEST4 column.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn 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

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.