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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Mahamood0218
Helper II
Helper II

Need to find date difference between two columns

Hi PBI Experts,

 

I have one simple requirment need to findout date differnece between ''Service date'' and ''Term.Date''

Mahamood0218_0-1663648989147.png

But for Emp.No - 19031 i dont have data in "Service Date" Column at that time i need to take data  from ''Valid from'' first column data (ex. - emp no - 19031 ,Valid from - 11-04-2019 and term date - 11-04-2022) 

Mahamood0218_1-1663649019412.png

here i need to find date difference between Valid from and Term.Date) here i need find two condition in single caluclated column dax function could you please suggest.

 

 

1 REPLY 1
ND_Pard
Helper II
Helper II

This "appears" to be an Excel spreadsheet with merged cells.
Assuming Emp.No "19031" is in merged cell A5 and it's associated TermDate of "11-04-22" is actually a DATE field and is in merged cell E5 and that all records in columns B thru E are DATE fields, in cell F2 the following formula could be entered and then copied down:

    =IF(ISBLANK(E2),"",IF(ISBLANK(D2),E2-C2,E2-D2))

temp.jpg

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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