Reply
BartVlek
Helper II
Helper II
Syndicated - Inbound

Año a la fecha del año pasado

Source Community: Power BI

Hola estoy usando la fórmula de trabajo a continuación para calcular nuestro volumen de negocios YTD.

YTD_2020: CALCULATE(SUM('FACTVERKOOP_ALL'[BRUTO_OMZET]); Año('FACTVERKOOP_ALL'[FECHA])-Año(HOY()))

¿Qué fórmula puedo usar para obtener el resultado del año anterior?

Muchas gracias de antemano

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

Source Community: Power BI
Syndicated - Inbound

@BartVlek , Con una tabla de fechas

LYTD QTY á TOTALYTD(Sum('order'[Qty]),dateadd('Date'[Date],-1,year))

LYTD QTY forzado
var _max á date(year(today())-1,month(today()),day(today()))
devolución
CALCULATE(Sum('order'[Qty]),DATESYTD(dateadd('Date'[Date],-1,year)),'Date'[Date]<-_max)

O

LYTD QTY forzado
var _max á date(year(today())-1,month(today()),day(today()))
devolución

if('Date'[Date]<-_max,CALCULATE(Sum('order'[Qty]),DATESYTD(dateadd('Date'[Date],-1,year))), blank())

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

Source Community: Power BI
Syndicated - Inbound

@BartVlek , Con una tabla de fechas

LYTD QTY á TOTALYTD(Sum('order'[Qty]),dateadd('Date'[Date],-1,year))

LYTD QTY forzado
var _max á date(year(today())-1,month(today()),day(today()))
devolución
CALCULATE(Sum('order'[Qty]),DATESYTD(dateadd('Date'[Date],-1,year)),'Date'[Date]<-_max)

O

LYTD QTY forzado
var _max á date(year(today())-1,month(today()),day(today()))
devolución

if('Date'[Date]<-_max,CALCULATE(Sum('order'[Qty]),DATESYTD(dateadd('Date'[Date],-1,year))), blank())

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Source Community: Power BI
Syndicated - Inbound

@BartVlek

var maxyear á YEAR(TODAY())

YTD_2020: CALCULATE(SUM('FACTVERKOOP_ALL'[BRUTO_OMZET]); Año('FACTVERKOOP_ALL'[FECHA])-maxyear)

y se puede utilizar el mismo sustrato uno para geet el año pasado

var maxyear á YEAR(TODAY())

LYTD_2019 : CALCULATE(SUM('FACTVERKOOP_ALL'[BRUTO_OMZET]); Año('FACTVERKOOP_ALL'[FECHA])-maxyear-1)

Y para confirmar ¿está buscando año completo más las mismas fechas disponibles en el último año con el año pasado?

Si usted piensa que esto es útil por favor acepte esto como solución y deje un like.

saludos

Manikumar





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




avatar user

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)