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
Miguelcrz
Helper I
Helper I

VARIACIÓN DE LA SEMANA

Hola

Necesito tener el porcentaje de variación de mis ventas comparándolo con la última semana así:

Miguelcrz_0-1597354193061.png

Actualmente, mi Power BI tiene este aspecto:

Miguelcrz_1-1597354216692.png

Y mi tabla de tiempo se ve así (Semanacal - Número de la semana):

Miguelcrz_3-1597354255772.png

También he visto el foro las preguntas de personas que tenían el mismo problema pero no está funcionando para mí.

¡Gracias!

10 REPLIES 10
amitchandak
Super User
Super User

@Miguelcrz, en primer lugar tienen una tabla de semana separada. Debería incluir el año en eso. La mejor manera es utilizar el rango del año de la semana, Por favor, siga mi blog para eso.

Con la semana no. La fecha puede Semana -año/semana tabla

Esta semana: CALCULATE(sum('order'[sales]), FILTER(ALL('Date'),'Date'[Week]-max('Date'[Week])))
Last Week ? CALCULATE(sum('order'[sales]), FILTER(ALL('Date'),'Date'[Week]-max('Date'[Week])-1))

Con rango

Esta semana: CALCULATE(sum('order'[sales]), FILTER(ALL('Date'),'Date'[Week Rank]-max('Date'[Week Rank])))
Last Week ? CALCULATE(sum('order'[sales]), FILTER(ALL('Date'),'Date'[Week Rank]-max('Date'[Week Rank])-1))

referirlos para ver cómo funciona el rango

https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...

v-shex-msft
Community Support
Community Support

Hola @Miguelcrz,

Puede intentar utilizar la siguiente fórmula de medida si cumple con sus requisitos.

Measure =
VAR currWeek =
    MAX ( table[Week] )
VAR prevSales =
    CALCULATE (
        SUM ( table[Sales] ),
        FILTER ( ALLSELECTED ( table ), [Week] = currWeek - 1 )
    )
RETURN
    DIVIDE ( SUM ( table[Sales] ) - prevSales, prevSales, -1 )

Si arriba no ayuda, proporcione algunos datos ficticios para ayudarnos a aclarar su escenario y probar la fórmula de codificación en él.
saludos

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
FrankAT
Community Champion
Community Champion

Hola @Miguelcrz

¿Es eso lo que estás buscando?

14-08-_2020_00-13-05.png

Saludos FrankAT

Anand24
Super User
Super User

Hola @Miguelcrz ,

¿Puede crear una nueva columna con dax a continuación:

Last Calendar Week Sales ? CALCULATE( [Total Sales], 'Calendar'[Número de Semana] - WEEKNUM(TODAY(),1) -1 )

Utilice esta opción para crear otra columna calculada para % de variación con el siguiente DAX:

Percent_Variation (([Ventas totales]-[Ventas de la última semana del calendario])/[Ventas de la última semana del calendario])*100

Dale un pulgar hacia arriba si este post te ayudó de alguna manera y marca este post como solución si resolvió tu consulta !!!

Hi @Anand24 @amitchandak @v-shex-msft @FrankAT ! is not working. I only have the column week and the column sales. I have to calculate or do a new column to calculate the sales from last week but i dont know how. Then i need to calculate the variation between the sales of this week vs last week.

 

Thanks!

Hola @Miguelcrz

aquí hay otra solución a su pregunta. Utilice las tres medidas siguientes.

15-08-_2020_01-53-27.png

Saludos FrankAT

HI @FrankAT , it doesnt work :(.

 

 

Hola @Miguelcrz,

Usted nos dijo que estos códigos no funcionan sin ninguna información detallada, no ayudan a resolver su escenario y difícil de aclarar / solucionar los problemas.
¿Puede proporcionar un archivo pbix con datos ficticios y fórmulas para probar? Creo que debería ayudar a probar la fórmula de codificación en los datos de muestra. (eliminar datos confidenciales antes del recurso compartido)

Cómo obtener respuestas a su pregunta rápidamente

saludos

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi! is not working. I only have the column week and the column sales. I have to calculate or do a new column to calculate the sales from last week but i dont know how. Then i need to calculate the variation between the sales of this week vs last week.

 

Thanks!

Hi @Miguelcrz 

here another solution to your question. Use the three measures below.

 

15-08-_2020_01-53-27.png

 Regards FrankAT

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.