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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Cálculo del cambio mes a mes de una suma móvil de 12 meses

Hola

Estoy tratando de calcular el cambio de porcentaje mensual para una suma de 12 meses. Intenté usar dos medidas rápidas, promedio móvil (que se cambió a suma) y cambio mes a mes. Sin embargo, el cambio de mes es incorrecto para todos, excepto para la primera fila. ¿Cómo obtengo números precisos de cambio mes tras mes? Soy nuevo en PowerBI y no tengo mucha experiencia con DAX.

A continuación se presentan mis medidas:

Suma rodante de EBITDAE MoM%

SI(

ISFILTERED('div_dept_EBITDAE'[Fecha]),

ERROR("Las medidas rápidas de inteligencia de tiempo solo se pueden agrupar o filtrar por la jerarquía de fechas proporcionada por Power BI o la columna de fecha principal."),

VAR __PREV_MONTH ?

CALCULATE(

[Suma rodante EBITDAE],

DATEADD('div_dept_EBITDAE'[Fecha].[ Fecha], -1, MES)

)

devolución

DIVIDE([EBITDAE rolling sum] - __PREV_MONTH, __PREV_MONTH)

)

Suma rodante de EBITDAE ?

SI(

ISFILTERED('div_dept_EBITDAE'[Fecha]),

ERROR("Las medidas rápidas de inteligencia de tiempo solo se pueden agrupar o filtrar por la jerarquía de fechas proporcionada por Power BI o la columna de fecha principal."),

VAR __LAST_DATE á ENDOFMONTH('div_dept_EBITDAE'[Fecha].[ Fecha])

VAR __DATE_PERIOD ?

FECHAS ENTRE FIN(

'div_dept_EBITDAE'[Fecha]. [Fecha],

STARTOFMONTH(DATEADD(__LAST_DATE, -12, MES)),

__LAST_DATE

)

devolución

SUMX(

CALCULATETABLE(

RESUMEN(

VALUES('div_dept_EBITDAE'),

'div_dept_EBITDAE'[Fecha]. [Año],

'div_dept_EBITDAE'[Fecha]. [QuarterNo],

'div_dept_EBITDAE'[Fecha]. [Cuarto],

'div_dept_EBITDAE'[Fecha]. [MonthNo],

'div_dept_EBITDAE'[Fecha]. [Mes]

),

__DATE_PERIOD

),

CALCULATE(

SUM('div_dept_EBITDAE'[EBITDAE]),

ALL('div_dept_EBITDAE'[Fecha].[ Día])

)

)

)

3 REPLIES 3
v-eachen-msft
Community Support
Community Support

Hola @lfietz ,

¿Podría compartir sus datos de muestra y el resultado esperado aquí si no tiene ninguna información confidencial? Cargue sus archivos en OneDrive para la Empresa y comparta el enlace aquí.

Este es un caso similar para su referencia.

https://community.powerbi.com/t5/Desktop/Rolling-12-months-data/m-p/1088093

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
amitchandak
Super User
Super User

@lfietz , Pruebe con una tabla de fechas

Rolling 12 á CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],ENDOFMONTH(Sales[Sales Date]),-12,MONTH))
Rolling 12 á CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],max(Sales[Sales Date]),-12,MONTH))
Rolling 12 hasta los últimos 12 meses - CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],ENDOFMONTH(dateadd(Sales[Sales Date],-12,month)),-12,MONTH))

Para obtener lo mejor de la función de inteligencia del tiempo. Asegúrese de que tiene un calendario de fechas y que se ha marcado como la fecha en la vista de modelo. Además, únase a ella con la columna de fecha de su/s hecho/s. Consulte:
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

Vea si mi seminario web sobre Time Intelligence puede ayudar: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-Y...


Apreciamos tus Felicitaciones.

Greg_Deckler
Super User
Super User

No es realmente suficiente información para seguir adelante, por favor primero compruebe si su problema es un problema común enumerado aquí: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Además, consulte este post sobre cómo obtener respuesta a su pregunta rápidamente: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

Las partes más importantes son:
1. Datos de muestra como texto, utilice la herramienta de tabla en la barra de edición
2. Salida esperada de los datos de muestra
3. Explicación en palabras de cómo obtener de 1. a 2.


Follow on LinkedIn
@ 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...

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.