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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
grechill
Helper I
Helper I

Promedio móvil para finales de año

Hola

Estoy tratando de obtener una medida fija para mostrarme una suma de medida promedio móvil al final del año ignorando todos los demás filtros de fecha.

He probado varias opciones como la siguiente, pero ninguna parece darme el resultado deseado.

Run Rate test = CALCULATE([Run Rate (interim) rolling average];FILTER(ALL(_Calendar);_Calendar[Date].[Year] = "2020"))

Aquí está mi medida promedio móvil.

Run Rate (interim) rolling average = 
IF(
 ISFILTERED('_Calendar'[Date]);
 ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column.");
 VAR __LAST_DATE = ENDOFMONTH('_Calendar'[Date].[Date])
 VAR __DATE_PERIOD =
  DATESBETWEEN(
   '_Calendar'[Date].[Date];
   STARTOFMONTH(DATEADD(__LAST_DATE; -12; MONTH));
   ENDOFMONTH(DATEADD(__LAST_DATE; 12; MONTH))
  )
 RETURN
  AVERAGEX(
   CALCULATETABLE(
    SUMMARIZE(
     VALUES('_Calendar');
     '_Calendar'[Date].[Year];
     '_Calendar'[Date].[QuarterNo];
     '_Calendar'[Date].[Quarter];
     '_Calendar'[Date].[MonthNo];
     '_Calendar'[Date].[Month]
    );
    __DATE_PERIOD
   );
   CALCULATE(SUM('Revenue'[Run Rate (interim)]); ALL('_Calendar'[Date].[Day]))
  )
)

¡Gracias de antemano!

3 REPLIES 3
Greg_Deckler
Super User
Super User

Difícil de decir sin datos de muestra para probar. Por favor, consulte este post sobre cómo obtener su pregunta respondida rápidamente: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

Quizás:

Esto parece un problema de agregación de medidas. Vea mi artículo de blog sobre eso aquí: https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

No lo entendí completamente. Pero tenemos rodar como

Rolling 12 - CALCULATE(Average(Sales[Sales[Sales Amount]),DATESINPERIOD('Date'[Date],ENDOFMONTH(Sales[Sales Date]),-12,MONTH))

O

YTD - CALCULATE(Average(Sales[Sales Amount]),DATESYTD(('Date'[Date]),"12/31"))

Hola @amitchandak ,

Esas medidas se limitarían a la DTE Y no avanzarían, si fuera necesario. No se pueden usar para la previsión. Estoy interesado en la previsión en particular.

Me gustaría que Power BI me muestre una previsión de fin de año independientemente de los filtros que se aplican en la segmentación de fechas. Pronostico todos los meses de actualización rodando avg, luego hago que las segmentaciones de fecha no sean válidas con ALL() funcion y luego aplico el filtro de año. Por una fuerza, Power BI está produciendo un error, sin embargo, la fórmula me parece lógicamente correcta. ¿Alguna idea de dónde está el error?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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