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
Paulyeo11
Impactful Individual
Impactful Individual

¿Cómo tener expresión para calcular el importe de ventas del año pasado?

Hola a todos

Necesito expresión para calcular el último año desde el ero hasta el monto de ventas de diciembre.

Por ejemplo, para obtener el importe de ventas del año actual, utilizo la siguiente expresión :-

Paulyeo11_0-1608179229045.png

https://www.dropbox.com/s/wkz53debb0z7017/PBT_V01007%20how%20to%20get%20last%20year%20total%20sales....

El enlace anterior es mi archivo PBI.

No puedo usar la siguiente expresión, ya que sólo calculará hasta YTD :-

Ventas LYTD ?
var _max á date(year(today())-1,month(today()),day(today()))
devolución
TOTALYTD(('SALES'[SALES_]),dateadd('Date'[Date],-1,year),'Date'[Date]<-_max)
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Paulyeo11 , Una medida como estas debería funcionar con la tabla de fechas

Ventas YTD á CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales á CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
Este año Ventas: CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR('Date'[Date]),"12/31"))
Ventas del año pasado: CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))
Last to last YTD Sales - CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-2,Year),"12/31"))

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Paulyeo11 , Por favor, encuentre el archivo adjunto después de la firma

Hola Amit

Muchas gracias por su ayuda siempre

Paul

amitchandak
Super User
Super User

@Paulyeo11 , Una medida como estas debería funcionar con la tabla de fechas

Ventas YTD á CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales á CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
Este año Ventas: CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR('Date'[Date]),"12/31"))
Ventas del año pasado: CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))
Last to last YTD Sales - CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-2,Year),"12/31"))

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.