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

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.

Reply
gauravnarchal
Post Prodigy
Post Prodigy

Calculate number of days between 2 dates - Different Table

Need help!

 

How can I calculate the number of days between Shipment Date in Table 2 & Invoice date in Table 1?

 

gauravnarchal_0-1597400900965.png

 

4 REPLIES 4
v-deddai1-msft
Community Support
Community Support

Hi @gauravnarchal ,

 

Please create an index column in both tables, and create an relationship between two table by the index column. Then you can use the following dax:

Capture2.PNG

 

Column = 'Table1'[Invooice Date]-RELATED(Table2[Shipment Date])

 

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

 

harshnathani
Community Champion
Community Champion

Hi @gauravnarchal ,

 

You can check if this helps

 

https://community.powerbi.com/t5/Desktop/Subtracting-Dates-within-Two-Different-Tables/td-p/398333

https://community.powerbi.com/t5/Desktop/Cross-table-Datediff/td-p/81075

 

Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

amitchandak
Super User
Super User

@gauravnarchal , refer this blog - Create a common table and then take diff

https://community.powerbi.com/t5/Community-Blog/Decoding-Direct-Query-in-Power-BI-Part-2-Date-Differ...

 

This file has 2-3 approaches. Copy data into another table and do it

https://www.dropbox.com/s/y47ah38sr157l7t/Order_delivery_date_diff.pbix?dl=0

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
lousegers
Resolver I
Resolver I

Hi @gauravnarchal ,

 

You can create a calculated column. Right click on the table, select "New Column", in the formula section you can use

Column Name = 1. * (Table[actual start date] - Table[target start date])

 

This should give you the negative number of days between the two dates.

 

Was my answer anywhere helpful?

Show your appreciation by simply marking my reply as solution or throw it a kudo.

 

Hop on the data train and get connected @LouSegers

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.