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
Snowy34
Helper III
Helper III

Exclude dates table Filter

Good day all, 

 

Here we are back with a new issue, what I have is two data tables, the first table holds my records of the deliveries from order date to delivered date. What I will like to add a column Days to Deliver that calculates the number of days it's taken to deliver an order.

 

Now, this is very easy to do but my issue is I got more than one warehouse in the report and each warehouse has its own days that need to be excluded and also excluded weekends. I have created a calculated column that returns of its a weekend or weekday so that part was simple.

 

So the below shows an order for WH222 has taken 2 days to delivery - the weekend, WH666 order has taken also 2days but that is because date 666 - 19/11/19 is excluded and so on. Think you get the picture.

 

So how could I create something that looks at the WH number first then looks at the excluded dates before it returns a result?

 

 

OrderWarehouseOrderedDeliveredDays to deliver

8518

222

15/11/19

19/11/192
884666615/11/1920/11/192
441288814/11/1919/11/193
     

 

exclude dates table 

 

WH-DATE

666 - 19/11/19

222 - 27/11/19

888 - 4/12/19

 

Regards 

Snowy

1 ACCEPTED SOLUTION

Hi,

Ensure that in the WH column of Table2, there are only unique values.  Also, in the Relatioinshop window, select Many to One and Singe.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

9 REPLIES 9
Ashish_Mathur
Super User
Super User

Hi,

Build a relationship from the Warehouse column of Table1 to the WH column of Table2.  In Table1, write this calculated column formula to bring over the Date from Table2 to Table1.

=RELATED('Table2'[Date])

Does this help?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur 

 

When I try and create the relationship I get this error "The cardinality you selected isn't valid for this relationship"

 

Regards 

Hi,

Ensure that in the WH column of Table2, there are only unique values.  Also, in the Relatioinshop window, select Many to One and Singe.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi, @Ashish_Mathur  again,

 

But if I do that most of my data is now gone apart from one day... across all the warehouses

 

o4RV9np

 

 

 

Hi,

I cannot understand what you are trying to tell me.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur 

 

Basically I need to get a number of days it has taken to deliver an item but excluding weekends and public holidays, this would be quite easy to do if I didn't have warehouses that are in different states. Meaning what is a public holiday in Wearhouse 666 not a public holiday in Wearhouse 222.

 

I created a table that holds all public holidays for each Wearhouse and I was hoping I could use that when figuring out my days taken to deliver an order.

 

I hope this clears out what my issue is.

Hi,

What problem do you run into when you impleent my suggested solution.  Please be specific.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Good day @Ashish_Mathur 

 

Thank you for your help, in the end, I got it working using your approach 🙂 

 

Regards

Snowy

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.