Quantcast
Viewing all articles
Browse latest Browse all 217263

Calculate days between dates in two separate tables

 Hello, 

 

I have three tables:

 

Product (Fact) ([Product ID], [Estimated Delivery Date ID], [Actual Delivey Date ID])

Estimated Delivery Date (EDD Dim) ([Estimated Delivery Date ID], [Date])

Delivery Date (DD Dim) ([Delivery Date ID], [Date])

 

Dim Tables for EDD and DD are two separate tables but are not directly related, except via their relationship with the Product fact table.

 

I would like to write three measures on the Product Table to:

 

1) Calculate the number of products where the EDD > DD

2) Calculate the average number of days/months/years etc between EDD and DD

3) For each product, calculate the number of days/months/years between EDD and DD

 

Could anyone suggest an approach to writing measures for any/all of the above?

 

Thanks!

 

Pbix


Viewing all articles
Browse latest Browse all 217263

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>