Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hola querida comunidad,
Me gustaría crear una nueva columna en mi tabla de calendario que proporcione el rango de tiempo en lugar del número de semana. Por ejemplo:
Para la semana número 1 de 2023, obtendremos un valor como "02/01 a 08/01".
ChatGPT intentó darme esta solución, que solo funciona durante el primer año 2023:
Muchas gracias Greg! Tu código funciona muy bien... hasta el cambio de año! Para todas las semanas en 2023 se escribe el rango de tiempo correcto, pero para la primera semana de 2024, el valor de la nueva columna es "01/01 a 31/12". ¿Cómo puedo corregirlo? Si tienes una idea.
@LZNPM Probar:
Range =
VAR __WeekNum = [WeekNum]
VAR __Year = YEAR([Date])
VAR __Min = MINX(FILTER('Dates', [WeekNum] = __WeekNum && YEAR([Date]) = __Year), [Date])
VAR __Max = MAXX(FILTER('Dates', [WeekNum] = __WeekNum && YEAR([Date]) = __Year), [Date])
VAR __Return = FORMAT(__Min, "dd/MM") & " to " & FORMAT(__Max, "dd/MM")
RETURN
__Return
@LZNPM Probar:
Range =
VAR __WeekNum = [WeekNum]
VAR __Min = MINX(FILTER('Dates', [WeekNum] = __WeekNum), [Date])
VAR __Max = MAXX(FILTER('Dates', [WeekNum] = __WeekNum), [Date])
VAR __Return = FORMAT(__Min, "dd/MM") & " to " & FORMAT(__Max, "dd/MM")
RETURN
__Return
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.