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
Sriku
Helper IV
Helper IV

Cómo calcular y mostrar la semana del mes

Hola a todos

Quiero calcular la semana de un mes particlar como para ser mostrado como w1, w2, w3 etc.

ejemplo Mes sep debe ser w1, w2, w3 etc

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hola @Sriku ,

Compruebe la fórmula.

Column =
VAR som =
    STARTOFMONTH ( 'Table'[date] )
VAR dat = 'Table'[date]
RETURN
    SWITCH (
        TRUE (),
        dat >= som
            && dat < som + 7, "w1",
        dat >= som + 7
            && dat < som + 14, "w2",
        dat >= som + 14
            && dat < som + 21, "w3",
        dat >= som + 21
            && dat < som + 28, "w4",
        "w5"
    )

El resultado se mostraría como se muestra a continuación.

3.PNG

Saludos

Jay

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

View solution in original post

2 REPLIES 2
v-jayw-msft
Community Support
Community Support

Hola @Sriku ,

Compruebe la fórmula.

Column =
VAR som =
    STARTOFMONTH ( 'Table'[date] )
VAR dat = 'Table'[date]
RETURN
    SWITCH (
        TRUE (),
        dat >= som
            && dat < som + 7, "w1",
        dat >= som + 7
            && dat < som + 14, "w2",
        dat >= som + 14
            && dat < som + 21, "w3",
        dat >= som + 21
            && dat < som + 28, "w4",
        "w5"
    )

El resultado se mostraría como se muestra a continuación.

3.PNG

Saludos

Jay

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

@Sriku , En primer lugar tienen la fecha de inicio de la semana

Fecha de inicio de la semana : 'Fecha'[Fecha]+-1*WEEKDAY('Date'[Fecha],2)+1

y mes año

Año del mes ? FORMAT([Fecha],"mmm-aaaa")
Mes Año orden - FORMAT([Fecha],"aaaamm")

min week start of month á minx(filter('Date',[Month Year] ?earlier([Month Year])),[Week Start date])

tratar de una columna como

semana del mes - datediff([min semana inicio del mes],[fecha],Semana)

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.