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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hello, I am a new bee. What is the DAX formula to measure and find out the date difference by using two dates from two different tables? I want the date difference Order Date . from the Sales table and the Delivery Date from the Sales Orders Sheet. Appreciate your help. How can I attached a file for you guys to see the problem?
Thanks
Solved! Go to Solution.
Hi @nafitycs -Calculating the date difference between the "Order Date" from the Sales table and the "Delivery Date" from the Sales Orders table. I hope there is a relationship exist between two tables (Sales table and the Sales Orders table) with common field.
Using calculated column,you can see the report in Table view or data view.
DateDifference =
DATEDIFF(
Sales[Order Date],
RELATED('Sales Orders'[Delivery Date]),
DAY
)
With measure also works if you are performing on aggregations and you can see value in report view.
DateDifferenceMeasure =
VAR OrderDate = SELECTEDVALUE(Sales[Order Date])
VAR DeliveryDate = RELATED('Sales Orders'[Delivery Date])
RETURN
DATEDIFF(OrderDate, DeliveryDate, DAY)
Hope it works. please check
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Proud to be a Super User! | |
HI @nafitycs Happy to Help!!
Proud to be a Super User! | |
Hi @nafitycs -Calculating the date difference between the "Order Date" from the Sales table and the "Delivery Date" from the Sales Orders table. I hope there is a relationship exist between two tables (Sales table and the Sales Orders table) with common field.
Using calculated column,you can see the report in Table view or data view.
DateDifference =
DATEDIFF(
Sales[Order Date],
RELATED('Sales Orders'[Delivery Date]),
DAY
)
With measure also works if you are performing on aggregations and you can see value in report view.
DateDifferenceMeasure =
VAR OrderDate = SELECTEDVALUE(Sales[Order Date])
VAR DeliveryDate = RELATED('Sales Orders'[Delivery Date])
RETURN
DATEDIFF(OrderDate, DeliveryDate, DAY)
Hope it works. please check
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Proud to be a Super User! | |
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.