cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Anonymous
Not applicable

¿Cómo calculo el total acumulado para el año anterior?

Tengo un total acumulado para el año en curso trabajando bien con

Ventas acumuladas - CY - calcular ( sum(Transactions[RevenueAmountGBP]),filter(ALLSELECTED(Transactions),Transactions[PostingDate] <- max (Transactions[PostingDate])))
También tengo una Venta para Año Anterior
Ventas - Año anterior - CALCULATE(SUM(Transactions[RevenueAmountGBP]), SAMEPERIODLASTYEAR('Date'[Date]))
Pero, ¿no se puede averiguar cómo obtener la cantidad correspondiente utilizando aplicar el filtro de fecha al mismo período del año pasado?
Cualquier ayuda sería muy apreciada.
5 REPLIES 5
Syndicate_Admin
Administrator
Administrator

Hola
He tratado de calcular solo las ventas acumuladas del año anterior, pero no pude lograrlo, intenté la fórmula que se da arriba, pero no puedo obtener el resultado.

v-eachen-msft
Community Support
Community Support

Hola @Power_B_Hi ,

Puede consultar las siguientes medidas:

Cumulative Sales - CY =
CALCULATE (
    SUM ( 'Transactions'[RevenueAmountGBP] ),
    FILTER ( ALLSELECTED ( 'Date' ), 'Date'[Date] <= MAX ( 'Date'[Date] ) )
)
Cumulative Sales - LY =
CALCULATE ( [Cumulative Sales - CY], SAMEPERIODLASTYEAR ( 'Date'[Date] ) )

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
Anonymous
Not applicable

Gracias por su respuesta es muy apreciado.

He seguido sus pasos y el CY acumulativo está funcionando correctamente, pero el PY sólo está informando de los totales montly no el acumulativo. ¿Me he perdido un escalón en alguna parte?

Puse mi CY como:

Cumulative Sales CY = calculate ( sum ( Transactions[RevenueAmountGBP] ), filter ( allselected ( 'date' ), 'Date'[Date] <= max ('Date'[Date])))

Y mi PY como:

Cumulative Sales PY = calculate ( [Cumulative Sales CY] , SAMEPERIODLASTYEAR('Date'[Date]))

Muchas gracias

Hola @Power_B_Hi ,

¿Podría compartir sus datos de muestra aquí si no tiene ninguna información confidencial? Cargue sus archivos en OneDrive para la Empresa y comparta el enlace aquí.

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
amitchandak
Super User
Super User

@Power_B_Hi , Consulte estos

Ejemplo acumulado

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(date,date[date] <=maxx(date,date[date])))
Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(date,date[date] <=max(Sales[Sales Date])))

hasta el año pasado

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(date,date[date] <=maxx(date,max(dateadd(date[date]),-1,year))))

no está seguro de si usted está buscando ytd

YTD Sales = 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"))
This Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR('Date'[Date]),"12/31"))
Last YTD complete Sales = 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"))
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))

Para obtener lo mejor de la función de inteligencia del 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, únase a ella con la columna de fecha de su/s hecho/s. Consulte:
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

Vea si mi seminario web sobre Time Intelligence puede ayudar: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-Y...


Apreciamos tus Felicitaciones.

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors