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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Mahamood0218
Helper II
Helper II

Date difference between two different tables columns

Hi PBI Experts,

We have two different tables Tabele1 and Table2 in that table i need find Caluclated Column dax function for  Date diffence between two tables(Joining date and Action date along with filter is Action Type = "Termination"), Here need to find Date difference(Joining date and Action date) and also apply the filter Action Type = "Termination",Could you please suggest  solution.

 

Thanks,

Shaik.

 

 

Mahamood0218_0-1661233564371.png

 

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @Mahamood0218 ;

Try it.

Diff = DATEDIFF(RELATED(Table1[Joining date]), [Action date],DAY)

The final show:

vyalanwumsft_0-1661853546771.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yalanwu-msft
Community Support
Community Support

Hi, @Mahamood0218 ;

Try it.

Diff = DATEDIFF(RELATED(Table1[Joining date]), [Action date],DAY)

The final show:

vyalanwumsft_0-1661853546771.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

ToddChitt
Super User
Super User

Do both tables have the same Unique Key on [Emp Id]? If so, you can join them via a relationship and specify one-to-one cardinality. From there, you can use a DAX function of RELATED ( ) to get to a value in another table.

My Date Diff in Table 1 = DATEDIFF( ....RELATED('Table 2'[Action Date])...) (sorry, I don't recall exact syntax of the functions.




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.