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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
JoseLuisC
Frequent Visitor

AYUDA .. MOSTRAR EL PROMEDIO DE LOS ULTIMOS 13 MESES

Hola...Estoy tratando de encontrar una medida DAX y que me muestre el promedio de los ultimos 13 meses del campo existencias , El resultado deberia ser 2,713,867   . 

 

La formula DAX que estoy usando para miostrar el promedi ode los 12 meses es  : 

Existencias_12M = VAR LastSelectedDate = MAX(DIM_TAB_CALENDAR[DATE])                                                                                                                    VAR PERIOD = DATESINPERIOD(DIM_TAB_CALENDAR[DATE],LastSelectedDate,-12,MONTH)        

 

                           VAR RESULT = CALCULATE(AVERAGEX(VALUES(DIM_TAB_CALENDAR[MES]),[Existencias]),PERIOD)                                                        RETURN RESULT  

 

 CapturaSSSSSS.JPG

2 REPLIES 2
v-jianboli-msft
Community Support
Community Support

Hi @JoseLuisC ,

 

Please try something like this:

Existencias_13M = 
VAR LastSelectedDate = MAX(DIM_TAB_CALENDAR[DATE])                                                                                                                    VAR PERIOD = FILTER(ALL('DIM_TAB_CALENDAR'),[DATE]<=EOMONTH(LastSelectedDate,0)&&[DATE]>EOMONYH(LastSelectedDate,-14))
VAR RESULT = CALCULATE(AVERAGEX(VALUES(DIM_TAB_CALENDAR[MES]),[Existencias]),PERIOD)                                                        RETURN RESULT  

 

Best Regards,

Jianbo Li

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

 

Syndicate_Admin
Administrator
Administrator

https://we.tl/t-teoQdBBPqj I attach the link to my file

Helpful resources

Announcements
Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors