Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hola
Tengo un problema con los números de la semana. He creado una columna llamada YearWeek usando lo siguiente:
Mis problemas es que las semanas no coinciden con las fechas correctas. Por ejemplo, en esta tabla muestra que la semana 3 está entre el 10-16 de enero, pero en realidad está entre el 17 y el 24 de enero. Quiero que la semana 1 comience con el 3 de enero.
¿Puede alguien ayudarme, por favor?
Agradecido por el apoyo,
Solved! Go to Solution.
Prueba esta fórmula:
YearWeek ? RIGHT(IF(WEEKNUM('Calendar'[Date], 21)-53 && MONTH('Calendar'[Date])-1, YEAR('Calendar'[Date]) -1, YEAR('Calendar'[Date])),2) & WEEKNUM('Calendar'[Date], 21)
Hola, ¿qué tal si solo quiero el número de semana, WW?
Gracias.
Si desea utilizar una semana Iso YEAR la fórmula debe ser así:
YearWeek = IF(WEEKNUM('Calendar'[Date], 21)=53 && MONTH('Calendar'[Date])=1, YEAR('Calendar'[Date]) -1, YEAR('Calendar'[Date])) & "-" & WEEKNUM('Calendar'[Date], 21)
Es necesario poner otro parámetro en la función weeknum.... el parámetro con el valor 21.
Véase también el siguiente enlace:
https://community.powerbi.com/t5/Desktop/Looking-for-real-year-week/m-p/1591530#M646306
Hola
Gracias por tu respuesta. Parece funcionar. Aunque es posible mostrar YYWW en lugar de YYYY-WW?
Atentamente
Prueba esta fórmula:
YearWeek ? RIGHT(IF(WEEKNUM('Calendar'[Date], 21)-53 && MONTH('Calendar'[Date])-1, YEAR('Calendar'[Date]) -1, YEAR('Calendar'[Date])),2) & WEEKNUM('Calendar'[Date], 21)
Gracias por el apoyo, realmente ayudó!