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.
Hola a todos,
Estoy tratando de encontrar una manera de calcular la suma R12M para cada uno de los meses en la tabla, como una sola medida. Me gustaría que se pareciera más o menos a esto:
Mes: | Enero de 2019 | Febrero 2019 | Marzo | Abril | Mayo | Junio | Julio | Agosto | Siete | Octubre | Noviembre | Diciembre | Ene 2020 | Febrero 2020 | Marzo de 2020 |
Valor: | 1 | 2 | 3 | 4 | 5 | 1 | 2 | 3 | 4 | 5 | 1 | 2 | 3 | 4 | 5 |
R12M: | 33 | 35 | 37 | 39 | |||||||||||
(suma marzo 2019 - feb 2020) | (suma de abril 2019-marzo 2020) |
Encontré una manera de calcular R12M este año y el año pasado, usando las fórmulas a continuación:
RTM (TY) - CALCULATE([Suma total de ventas]; DATESINPERIOD('Calendar'[Fecha]; MAX('Calendario'[Fecha]); -12; MES))
RTM (LY) - CALCULATE([Suma total de ventas]; DATEADD(DATESINPERIOD('Calendar'[Fecha]; MAX('Calendario'[Fecha]); -12; MES); -1; Año))
Sin embargo, con este enfoque tendría que crear una medida independiente para cada mes, y no es lo que quiero.
Le agradecería cualquier ayuda 🙂
@aleksaste no necesita crear dos medidas, poner año y mes a partir de la tabla de calendario y una medida funcionaría?
Me gustaría❤ elogiossi mi solución me ayudó.👉Si puedes pasar tiempo publicando la pregunta, también puedes hacer esfuerzos para darle a Kudos quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!
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.
¿Podría mostrarme cómo sería una medida así?
@aleksaste debería funcionar su medida RTM (TY)? Si no, comparta lo que no está funcionando.
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.
Hola, no era consciente de que simplemente puedo trazarlo en una línea de tiempo y se calculará. Por alguna razón estaba convencido de que tengo que usar algún tipo de variable para seleccionar un mes específico, porque pensé que siempre tomará toda la tabla de calendario (sin filtrar) como base. ¡Tan fácil! Gracias.
Hola
Aquí está mi tabla de prueba:
Por favor, siga estos pasos:
1)Crear una nueva tabla de segmentación de datos por Introducir datos:
2)Pruebe esta medida:
Measure =
VAR a =
IF (
MAX ( 'Table'[Date] ) >= DATE ( 2019, 12, 1 ),
CALCULATE (
SUM ( 'Table'[Value] ),
FILTER (
ALLSELECTED ( 'Table' ),
'Table'[Date] <= MAX ( 'Table'[Date] )
&& 'Table'[Date]
>= IF (
MONTH ( MAX ( 'Table'[Date] ) ) = 12,
DATE ( YEAR ( MAX ( 'Table'[Date] ) ) - 1, 1, 1 ),
DATE ( YEAR ( MAX ( 'Table'[Date] ) ) - 1, MONTH ( MAX ( 'Table'[Date] ) ) + 1, 1 )
)
)
)
)
RETURN
SWITCH (
SELECTEDVALUE ( 'Table 2'[Month] ),
"Value", SUM ( 'Table'[Value] ),
"R12M", a
)
3)El resultado muestra:
Vea mi archivo pbix adjunto.
Saludos
Giotto
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |
User | Count |
---|---|
2 | |
2 | |
2 | |
2 | |
1 |