Forum Discussion
How do an average for a column type date
When it comes to dates, there are two versions of the term 'average'...
1. If you want the 'MEDIAN' date, or the date in the middle of your date range, you can use this formula: (See first Date 2 column)
Add_Date2 = FIRSTDATE(Table1[Date2]) + INT(DATEDIFF(FIRSTDATE(Table1[Date2]),LASTDATE(Table1[Date2]),DAY) / 2)
2. If you truly want the Average or Mean date (taking each date into a weighted value) you can use this formula. But see how the value is different in the 2nd Date 2 / Num Days column.
Custom Column ... NumDays = DATEDIFF(0,Table1[Date2],DAY)
Measure Mean = FORMAT(DATE(2000,1, INT(AVERAGE( Table1[NumDays] ) -36523)),"YYYY-MM-DD")
- AlexGallet019 years agoHelper IV
When i want to create custom column i have an error she says error syntax or i write this
NumDays = DATEDIFF(0,TECHNIKE[THCJDATE];DAY)
- fhill9 years agoResident Rockstar
Is TECHNIKE[THCJDATE] formatted as a Date in Query Editor?
FOrrest
- AlexGallet019 years agoHelper IV
- AlexanderW4 years agoNew Member
Hi,
a few years later from origin post (still not solved?) but try using , instead of ; in you formulathat could do the trick for the rest of the calculations