Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
JANDRES
New Member

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 promedio a octubre 2023, se debe calcular desde diciembre 2022 hasta octubre 2023, si deseo obtener a diciembre el calculo va desde diciembre 2022 hasta diciembre 2023, en caso de cambiar de año es decir quiero obtener a febrero 2024 el calculo va desde diciembre 2023 (inicindo desde diciembre del año inmediato anterior) hasta febrero 2024.

Esperando sus apoyos. Gracias Totales 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @JANDRES 

 

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

 

Here's the dummy data

vnuocmsft_0-1703129746128.png

 

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

 

vnuocmsft_1-1703129777162.png

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).

vnuocmsft_2-1703129799267.png

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

 

Here is the result

vnuocmsft_3-1703129845143.png

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.

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @JANDRES 

 

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

 

Here's the dummy data

vnuocmsft_0-1703129746128.png

 

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

 

vnuocmsft_1-1703129777162.png

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).

vnuocmsft_2-1703129799267.png

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

 

Here is the result

vnuocmsft_3-1703129845143.png

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.

 

Hay alguna forma de calcular "asset", teniendo en cuenta que "asset" tiene otra columna con diferente divisiones?, por ejemplo:

dateasset

prod_asset

 
12/3/20221000A 
12/7/20223200A 
1/4/20235000A 
4/1/20234300A 
10/7/20237600A 
2/9/20246300A 
4/5/20247100A 
6/6/20245000B 

8/8/2024

1000B 


TOTAL_ASSET= SUM(ASSET)


asset = CALCULATE(TOTAL_ASSED, prod_asset="A")

 

 

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.