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. Estoy luchando con una expresión dax particular por el problema de abajo. Me gustaría crear una columna calculada que proporcione la suma de 12 meses por cliente por categoría. Hay muchos más clientes y categorías.
Datos de muestra :
Cliente | Categoría | Fecha | Valor | Resultado esperado (acumulación de 12 meses) |
A | F | 01/01/2019 | 10 | 10 |
A | F | 01/02/2019 | 2 | 12 |
A | F | 01/03/2019 | 7 | 19 |
A | F | 01/04/2019 | 4 | 23 |
A | F | 01/05/2019 | 3 | 26 |
A | F | 01/06/2019 | 4 | 30 |
A | F | 01/07/2019 | 5 | 35 |
A | F | 01/08/2019 | 2 | 37 |
A | F | 01/09/2019 | 6 | 43 |
A | F | 01/10/2019 | 3 | 46 |
A | F | 01/11/2019 | 1 | 47 |
A | F | 01/12/2019 | 5 | 52 |
A | F | 01/01/2020 | 2 | 44 |
A | F | 01/02/2020 | 8 | 50 |
Hola @Zabeer ,
También podría referirse a la siguiente medida para ver si funciona o no
Measure =
CALCULATE (
SUM ( 'Table'[Value] ),
FILTER (
ALLSELECTED ( 'Table' ),
'Table'[Date]
> DATE ( YEAR ( MIN ( 'Table'[Date] ) ), MONTH ( MIN ( 'Table'[Date] ) ) - 12, 1 )
&& 'Table'[Date] <= MIN ( 'Table'[Date] )
)
)
Saludos
Zoe Zhi
Si este post ayuda, por favor considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
Hola @Zabeer
Puede utilizar DATESINPERIOD
https://docs.microsoft.com/en-us/dax/datesinperiod-function-dax
Consulte el ejemplo de DAX Mesure a continuación.
Sales Rolling 12 months =
CALCULATE(
[Sales],
DATESINPERIOD( 'Calendar'[Date], MIN( 'Calendar'[Date] ) -1, -12, MONTH )
)
@Zabeer publicaciones similares en él y puede cambiarlo según las reglas de su negocio
https://www.sqlbi.com/articles/rolling-12-months-average-in-dax/
https://www.accountingweb.co.uk/business/finance-strategy/power-bi-rolling-12-months-and-ytd
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.
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 | |
2 | |
2 | |
2 | |
1 |