0
votes

I need to get the date difference from two datetime column in two different tables under the condition if one column in the first table equal second column in the second table.

The two table structures are as follow:

Table A: column1: order_ID
         column2: Order_DATE
Table B: column1: order_ID
         column2: Invoice_DATE
         column3: Invoice_ID

I need to have (invoice_date-order_date) where A.order_ID=B.Order_ID (this is under my SQL knowledge...but I have no idea how to put it in DAX language)

enter image description here

enter image description here

1

1 Answers

0
votes

You will need to create a relation between the 2 tables in PBI. Then add a column on table B where you can use the DATADIFF function to get the difference. The relation on the Order_ID is esential else there is no link between tables.

newColumn = DATEDIFF(TableB[invoice_date, TableA[Order_DATE], DAY)