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
Syndicate_Admin
Administrator
Administrator

diferencia del mes pasado vs mes actual

Hola

Estoy tratando de calcular la diferencia del mismo mes del año anterior con el mismo mes del año actual y quiero mostrar esa diferencia en una nueva columna, pero no quiero que el total muestre el total del año anterior, solo quiero ver solo el total de la diferencia como se muestra a continuación.

ene-21 10000

feb 21 15000

mar-21 25000

ene 22- 12000 2000

feb-22 20000 5000

total 7000

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

Hola

¿Afectará esto también a la columna total junto con la fila?

Syndicate_Admin
Administrator
Administrator

@kb177

Por favor, pruebe

Previous Year Sales Difference = 

VAR previousYearSales = 
CALCULATE(
    SUM(Sheet1[Sales]),
    DATEADD(Sheet1[Dates],-1,YEAR)
)

Var currentYearSales = 

CALCULATE(
    SUM(Sheet1[Sales])
)

RETURN

if([Previous Year Sales] >0,currentYearSales-[Previous Year Sales],"")

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.