Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
nafitycs
New Member

how to calculate Date diff measure from two different tables date field which is transformed into Tx

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

nafitycs_0-1718126910496.png

 

1 ACCEPTED SOLUTION
rajendraongole1
Super User
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!!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

3 REPLIES 3
nafitycs
New Member

@rajendraongole1 Thank you

HI @nafitycs  Happy to Help!!

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





rajendraongole1
Super User
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!!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.