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
yodha
Helper IV
Helper IV

Suma rodante de los últimos 3 meses

Hola, estoy tratando de crear una suma rodante para 3 meses, a partir del mes actual a los últimos 2 meses.

He probado esto:

Medidas ?CALCULATE([Cost %], DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-3,MONTH))

pero no está funcionando. Mi tabla de hechos "Fecha" coumn tiene muchos valores de dupliacte,

Capture.PNG Capture 2.PNG

y la relación entre la tabla de hechos y la tabla de fechas es de muchos a uno,

Capture 1.PNG

¿Cómo cambiar el DAX cuando hay valores duplicados? Cualquier ayuda en este apreciado.

Gracias.

5 REPLIES 5
parry2k
Super User
Super User

@yodha no está seguro de lo que está en su medida (coste %) pero debería ser -2 en lugar de -3

Me gustaría elogiossi mi solución ayudara.👉Si puedes pasar tiempo publicando la pregunta, también puedes hacer esfuerzos para dar a Kudos quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!

Visítenos enhttps://perytus.com, su ventanilla única para proyectos/formación/consulta relacionadas con Power BI.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

amitchandak
Super User
Super User

@yodha , la columna Fecha debe tener fechas duplicadas. Cómo has creado. Intente crear con la función de calendario y márquela como tabla de fechas. la fórmula es correcta

Ejemplo

Rolling 3 á CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],ENDOFMONTH(Sales[Sales Date]),-3,MONTH))
Rolling 3 á CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX(Sales[Sales Date]),-3,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.

@amitchandak : Gracias por la respuesta, hice lo mismo, creé la tabla de fechas usando la función calender, y lo que quiere decir"La columna De fecha debe tener fechas duplicadas?" ... hay duplicados en la columna de fecha de mi tabla de hechos.

jairoaol
Impactful Individual
Impactful Individual

la imagen no se ve bien. muy pequeña.

la tabla fechas NO debe tener valores duplicados. debe estar marcada como tabla de fechas.

en la formula debes tener en cuenta que se asume que tienes aplicado el filtro de fecha donde defines la fecha con la cual vas a buscar los 3 meses hacia atras.

@jairoaol : Hola, no hay duplicados en mi tabla de fechas / tabla de calender columna "fecha" pero hay duplicados en mi tabla de origen (tabla 1) columna de fecha (instantánea adjunta anterior), y sí estoy tratando de calcular la suma de balanceo desde atrás, gracias.

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.