# Help with dax calculation

Hi All,

I have been tasked to calculate an average outstanding time from a table.

The table has a Column called “Start date” which goes from (04/04/2018 - 31/01/2020) and the end date is taking the max date from the Start date which is the last date of each month.

However, the user wants me to calculate the average from 01/11/2018 - 01/01/2020. How do I write the measure for the “Start date” to start from 01/11/2018 -01/01/2020.

Thanks,
Chuk

Try this:

``````AvgDatesBTW =

CALCULATE(
AVERAGE(  Data[Column] ),
DATESBETWEEN(
Dates[Date],
1/11/2018,
1/1/2020
)
)
``````

where Data[Column] is the column you want average.

Alternatively, if it’s a measure you want to average rather than a column, modify the above slightly to use AVERAGEX:

``````AvgXDatesBTW =

CALCULATE(
AVERAGEX(
Data,
[Measure]
),
DATESBETWEEN(
Dates[Date],
1/11/2018,
1/1/2020
)
)
``````
• Brian
1 Like

Hi @Chukliz, we’ve noticed that no response has been received from you since the 17th of February. We just want to check if you still need further help with this post? In case there won’t be any activity on it in the next few days, we’ll be tagging this post as Solved. If you have a follow question or concern related to this topic, please remove the Solution tag first by clicking the three dots beside Reply and then untick the checkbox. Thanks!