The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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! | |
User | Count |
---|---|
70 | |
67 | |
62 | |
48 | |
28 |
User | Count |
---|---|
113 | |
78 | |
64 | |
55 | |
43 |