Forum Discussion
Date Difference between 2 columns same table.
- 1 year ago
Add a custom column and use Duration.TotalDays, like:
Duration.TotalDays( [Final Ruling Date] - [Initial Ruling Date] )When doing addition with dates, you'll get a duration as an output. This function converts that duration to # days.
Output would look like the following. Note that if the initial or final date are null, then the custom column will also be null. I added nulls to your initial data to show this.
Hello inglexjc
If you wanted to calculate this in Power BI with DAX, create a column with below DAX
DATEDIFF(
'Table'[Initial Ruling Date],
'Table'[Final Ruling Date],
DAY
)
Or, if you are on Import mode and would like to have them calculated during data load, in Power Query, Add one Custom Column with below M code:
Duration.Days([Final Ruling Date] - [Initial Ruling Date])
This will also create a new column showing the difference in days.
Hope this helps:)