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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Syndicate_Admin
Administrator
Administrator

obtener último período del trimestre ANTERIOR

Hola

Construyo el siguiente cálculo para obtener el último período del trimestre actual:
CALCULAR (
SUMA(_COFI[volumen]),
_COFI[level2] = "Activos",
ENDOFQUARTER(_COFI[PERIOD])
)

Ahora estoy tratando de obtener : último período del trimestre anterior.
Todavía puedo obtener el último período (con "endofquarter") pero siempre del trimestre actual y no del trimestre anterior.
Aquí está uno de los ejemplos que probé con DATESINPERIOD :
CALCULAR (
SUMA(_COFI[volumen]),
_COFI[level2] = "Activos",
ENDOFQUARTER(DATESINPERIOD(_COFI[PERIOD], MAX(_COFI[PERIOD]), -1, QUARTER)
))

Todos mis datos están dentro de 1 sola tabla, como se muestra a continuación:

Anonymous54000_0-1689234905819.png

Si alguien tiene jus an indea cómo debo procesar, ya ayudaría mucho.

¡Gracias!

1 REPLY 1
Syndicate_Admin
Administrator
Administrator

@Anonymous54000 , con ayuda de la tabla de fechas

QTD Ventas = CALCULAR(SUMA(Ventas[Importe de ventas]),DATESQTD(('Fecha'[Fecha])))
Last QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-1,QUARTER)))


Qtr Ventas = CALCULAR(SUMA(Ventas[Importe de ventas]),DATESQTD(ENDOFQUARTER('Fecha'[Fecha])))

Ventas del último TRIMESTRE = CALCULAR(SUMA(Ventas[Importe de ventas]),DATESQTD( ENDOFQUARTER(dateadd('Fecha'[Fecha],-1,TRIMESTRE))))
Ventas del último TRIMESTRE = CALCULAR(SUMA(Ventas[Importe de ventas]),ANTERIORTRIMESTRE(('Fecha'[Fecha])))

Para el último período de QTR, use esta medida en lugar de la suma de ventas

Ventas MTD = CALCULAR(SUMA(Ventas[Importe de ventas]),DATESMTD('Fecha'[Fecha]))

QTD Sales = CALCULATE([MTD Sales],DATESQTD(('Date'[Date])))
Last QTD Sales = CALCULATE([MTD Sales],DATESQTD(dateadd('Date'[Date],-1,QUARTER)))


Qtr Sales = CALCULATE([MTD Sales],DATESQTD(ENDOFQUARTER('Date'[Date])))

Ventas del último trimestre = CALCULAR([Ventas MTD],DATESQTD( ENDOFQUARTER(dateadd('Date'[Date],-1,QUARTER))))
Ventas del último trimestre = CALCULAR([Ventas MTD],ANTERIORTRIMESTRE(('Fecha'[Fecha])))

Por qué falla la inteligencia del tiempo - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...
Para obtener lo mejor de la función de inteligencia de 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, únalo con la columna de fecha de su(s) hecho/s. Referir: radacad sqlbi Mi serie de videos Aprecia tus felicitaciones.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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