How to Calculate Number of Days Between Two Dates in Power BI


I have a table with customer information, including a target start date of the contract and the actual start date. I would like to add an additional column showing the number of days the contract actually started before (negative number) of after (positive number) the target start date.


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 a negative number of days between the two dates.


you can create a measure by using a similar formula as solution 1.


You can also use the Dax expression DatesBetween Documentation is found here.

Days Between = DATESBETWEEN( ‘Table'[Dates], ‘Table'[Start Date], ‘Table[End Date] )  

This will return a single number for the number of days between the two dates.