Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Add Average of column into a dateaa function

I am showing a calculated column in a tbale format. I want take the average of that column and add it to the number of interval in DateAdd function.   Below is the ss. The average value of the Date...
  • v-zhangti's avatar
    3 years ago

    Hi, Anonymous 

     

    You can try the following methods.

    AverageMeasure = 
    VAR _AverageValue = 
    CALCULATE(AVERAGE(MCSdrop1[DateDiff-PC]),ALL('MCSdrop1'))
    RETURN
    MAX(MCSdrop1[ArrivalDate])+_AverageValue

    Is this the result you expect? It is not recommended that you use the Dateadd function in this case.

     

    DATEADD returns a table that contains a column of dates, It cannot be written directly in measure.

    • The result table includes only dates that exist in the dates column.

    • If the dates in the current context do not form a contiguous interval, the function returns an error.

    DATEADD function (DAX) - DAX | Microsoft Learn

     

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.