Forum Discussion

Raj12's avatar
Raj12
Icon for Helper III rankHelper III
4 years ago
Solved

How to take the difference of two different table date columns in power bi?

How do I take the difference of two different table date columns that are connected with ID's  as Many to MAny relationship in power bi?

I have two different datetime columns in two different tables T1 and T2. I have defined a many-to-many relationship between the two tables using a common column named 'id'. I want to make a new column that stores the difference of the datetime columns, for which I used the following command:

date3= DATEDIFF('T1'[date1], 'T2'[date2],DAY)

This command is not working and the message says, "A single value of date2 cannot be determined in the table T2".

. How do I take the difference?