Forum Discussion

JANDRES's avatar
JANDRES
New Member
2 years ago
Solved

PROMEDIO CON CONDICION DE FECHA

Hola  a Todos Necesito calcular el promedio de los activos, pero este calculo se realiza de manera condicional iniciando desde diciembre del año inmediato anterior, Ejemplo, si voy a sacar el activo...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi JANDRES 

     

    Regarding the average asset you want to calculate, here is the solution we offer:

     

    Here's the dummy data

     

    First, you'll need a calculated column to determine the start date (December of the previous year) for each row in the table

     

    last date = DATE(YEAR([date])-1, 12, 1) 

     

    Then, create a measure that calculates the average of the assets between the start date and the end date (current date or selected date).

    avg_asset = CALCULATE(AVERAGE(Assets[asset]),
    FILTER(ALLSELECTED(Assets),
    [date] >= MAX([last date]) && [date] <= MAX([date])))
    

     

    Here is the result

    Best Regards,

    Nono Chen

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