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

Último valor de la semana de previuos

Hola

Tengo una tabla (Clasificaciones) con múltiples valores (5 Clasificaciones por estrellas) por día y se acumulan, así:

FechaDía laborableWeeknum5 Clasificaciones por estrellas
28.02Sol91.000
28.02.Sol91.100
01.03Mi101.150
01.03Mi101.160
02.03Mar101.200
03.03Mié101.300
03.03Mié101.356
...
07.03Sol101.500

OBJETIVO: Quiero una medida que me muestre por semana el último valor de la semana anterior. Así que puedo calcular promedios, etc. con diferencias, etc.

Así que como:

Actual Anterior
Semana 91.100...
Wek 101.5001.100

La semana actual es fácil con SUM y MAX Date.

Para la semana anterior lo intenté así:

Prev.Week =

CALCULATE(SUM(Ratings[5Star]),FILTER(ALL(Ratings),Ratings[Weeknum]=MAX(Ratings[Weeknum])-1&&Ratings[Fecha]=MAX(Ratings[Date])))

No me muestra nada.

Thx para tu ayuda.

Micha

1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

@blamic

Puede probar la siguiente fórmula:

Prev.Week = 
CALCULATE(SUM(Ratings[5Star]),FILTER(ALL(Ratings),Ratings[Weeknum]=(MAX(Ratings[Weeknum])-1) && Ratings[Date]=(Ratings[Date]+ 7-WEEKDAY(Ratings[Date],2)) ) )

View solution in original post

4 REPLIES 4
Syndicate_Admin
Administrator
Administrator

@blamic

Puede probar la siguiente fórmula:

Prev.Week = 
CALCULATE(SUM(Ratings[5Star]),FILTER(ALL(Ratings),Ratings[Weeknum]=(MAX(Ratings[Weeknum])-1) && Ratings[Date]=(Ratings[Date]+ 7-WEEKDAY(Ratings[Date],2)) ) )

@amitchandak thx. Weekrank ayudó mucho thx.

Tengo la suma de la semana anterior hasta ahora:

CALCULATE(SUM(Ratings_iOS[1Star]),FILTER(ALL(Date_global),Date_global[Rango de semana]=MAX(Date_global[Rango de semana])-1))
¿Cómo lo combino con MAX, para obtener sólo el último valor de la semana anterior?

@blamic

Si quieres el valor del último día de la semana anterior intenta añadirlo a tu fórmula:

&& Ratings[Date]=(Ratings[Date]+ 7-WEEKDAY(Ratings[Date],2))

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.