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
HenryJS
Post Prodigy
Post Prodigy

Columna de número de semana personalizada

Hola a todos

¿Cómo puedo crear una columna Número de semana a partir de una columna de fecha que tengo en mis datos?

Quiero que el siguiente rango de datos sea 'Semana 1' y así sucesivamente...

10/04/20 00:00:00 - 17/04/2020 00:00:00 - SEMANA 1

Gracias

2 ACCEPTED SOLUTIONS
jdbuchanan71
Super User
Super User

Hay una función de número de semana en DAX que debería funcionar para usted.

Column = 
VAR _Wk = WEEKNUM ( DATES[Date] )
RETURN
"week " & _Wk

View solution in original post

v-eachen-msft
Community Support
Community Support

Hola @HenryJS ,

Puede hacer referencia a los siguientes códigos en el editor de consultas.

= "WEEK " & Number.ToText(Date.WeekOfYear([Column1]))

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

6 REPLIES 6
v-eachen-msft
Community Support
Community Support

Hola @HenryJS ,

Puede hacer referencia a los siguientes códigos en el editor de consultas.

= "WEEK " & Number.ToText(Date.WeekOfYear([Column1]))

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
amitchandak
Super User
Super User

@HenryJS, puedes hacer lo que quieras.

reemplazar el startofyear('Date'[Date]) con la fecha de inicio que desee

Week Start With Year=  QUOTIENT(DATEDIFF(STARTOFYEAR('Date'[Date]),'Date'[Date],DAY),7)+1 

Week Start Date with Year = var _1 =QUOTIENT(DATEDIFF(STARTOFYEAR('Date'[Date]),'Date'[Date],DAY),7) return STARTOFYEAR('Date'[Date]) + if(_1<52,_1,51)*7

jdbuchanan71
Super User
Super User

Hay una función de número de semana en DAX que debería funcionar para usted.

Column = 
VAR _Wk = WEEKNUM ( DATES[Date] )
RETURN
"week " & _Wk
ryan_mayu
Super User
Super User

@HenryJS

Tengo algunas preguntas

1. Hay 8 días desde el día 10 hasta el día 17. ¿Quieres que cada semana personalizada tenga 8 días?

2. ¿Cómo detener la semana? Si no configura el día de la terminal. El número de semanas seguirá creciendo.

Column = 
VAR week="week"&ROUNDUP(('Table'[Date]-date(2020,4,10)+1)/7,0)
return if('Table'[Date]<date(2020,4,10),blank(),week)

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




como se detienen las semanas? al llegar al 31 de diciembre deberia de parar.

@Syndicate_Admin

parece que el año fiscal y el año calendario son los mismos. A continuación, puede utilizar la función WEEKNUM

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.