Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Buenas tardes
Al igual que muchos otros, tengo problemas para que mi cambio semanal funcione correctamente.
He visto numerosos vídeos, pero ahora me he convertido en nudos. Así que extendiendo la mano para desenredarme.
Solo necesito que mi medida APBalance_PriorWeek funcione, luego puedo continuar con %Change.
Resumen de la tabla de datos:
| Año-SemanaNúmUn | Última fecha | CategoríaDeEdad | APBalance_Weekly |
| 2025-07 | 2/16/2025 | Actual | $3,830 |
| 2025-07 | 2/16/2025 | 30Días | $2,672 |
| 2025-07 | 2/16/2025 | 60Días | $1,366 |
| 2025-08 | 2/23/2025 | Actual | $3,288 |
| 2025-08 | 2/23/2025 | 30Días | $2,340 |
| 2025-08 | 2/23/2025 | 60Días | $1,332 |
| 2025-09 | 3/2/2025 | Actual | $3,021 |
| 2025-09 | 3/2/2025 | 30Días | $2,976 |
| 2025-09 | 3/2/2025 | 60Días | $548 |
| 2025-10 | 3/9/2025 | Actual | $2,118 |
| 2025-10 | 3/9/2025 | 30Días | $2,074 |
| 2025-10 | 3/9/2025 | 60Días | $1,323 |
| 2025-11 | 3/12/2025 | Actual | $2,181 |
| 2025-11 | 3/12/2025 | 30Días | $2,032 |
| 2025-11 | 3/12/2025 | 60Días | $1,349 |
Mi medida es:
APBalance_Weekly = CALCULATE( SUM( APAging[Balance(,000)] ),
FILTER( DIM_Date, DIM_Date[Date] = MAX( DIM_Date[Date] )))
Solo como nota, mi archivo de saldo de AP se actualiza diariamente. Entonces, para la semana actual (2025-11) el saldo es a partir de la última fecha.
Gracias de antemano y saludos cordiales,
No es bonito, pero debería funcionar
previousWeek =
var maxdt = MAX( dates[Date] )
var maxdtPerWeek =
CALCULATETABLE(
ADDCOLUMNS(
SUMMARIZE( dates, dates[Week No] )
,"@MaxDate", CALCULATE( MAX( dates[Date] ) )
),
REMOVEFILTERS( dates )
,dates[Date] <= maxdt
)
var prevWeek =
INDEX(
2,
maxdtPerWeek
,ORDERBY( [@MaxDate], desc )
)
var prevWeekDate =
SELECTCOLUMNS(
prevWeek
,"@date", [@MaxDate]
)
RETURN
CALCULATE(
SUM( 'Table'[balance] ),
TREATAS( prevWeekDate, dates[Date] )
)
@Deku ,
Parece que me está funcionando. Tendré que estudiarlo con más detalle para entenderlo, pero parece ser una solución que buscaba.
Gracias de nuevo y disculpas por la demora en la respuesta.
@Deku ,
Gracias por la respuesta. No estoy seguro de si podré atender esto hoy, pero lo intentaré cuando tenga la oportunidad.
Atentamente
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.