Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi,
I need to calculate the difference between dates from two different tables. The tricky part is that both date columns (marked with red lines) are kept in tables connected as in the picture below:
purple, blue and green lines represent different sets of key used to connect all of the tables together.
I already tried datediff(data1, related(date2),day) method, but it says that tables need to be connected. As you can see, they are but not directly.
May I ask for your assistance on this?
@Danielnir Maybe:
Measure =
VAR __Date1 = MAX('SOPOrderReturn'[RequestedDeliverDate])
VAR __Date2 = MAX('SOPInvoiceCredit'[DocumentDate]
RETURN
( __Date1 - __Date2 ) * 1.
Should I mention that I have something around 23k dates to compare? That's just comparing the highest date from one to the highest date from the second. My bad, I wasn't precise enough. Also tried changing MAX to SELECTEDVALUE but it resulted in a blank column...