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
Rommel
Frequent Visitor

SEMANA DEL MES QUE COMIENCE EN UN DIA HABIL

ESTIMADOS BUENAS NOCHE, ESTOY TRABAJANDO EN LA DIMENSIÓN TIEMPO, Y NECESITO QUE LA SEMANA DEL MES EMPIEZE EN EL  PRIMER DIA HABIL DEL MES (NO SABADO NI DOMINGO), TENIENDO EN CUENTA QUE ALGÚN MES COMO ABRIL (EL PRIMER DÍA CAE SABADO) PARA ESOS CASOS LA PRMERA SEMANA DEL MES DE ABRIL DEBERIA ENPEZAR EL LUNES, POR FAVOR ESPERO SU GRAN AYUDA.

 

FECHA.png

3 REPLIES 3
v-shex-msft
Community Support
Community Support

Hi @Rommel,

 

You can try to use below formula to find out ther find monday of each month.

 

Sample table:

8.PNG

 

Formula:

Calculate column version:
First Monday =
MINX (
    FILTER (
        ALL ( 'Table' ),
        FORMAT ( [Date], "mm/yyyy" ) = FORMAT ( EARLIER ( 'Table'[Date] ), "mm/yyyy" )
            && WEEKDAY ( [Date], 2 ) = 1
    ),
    [Date]
)

Measure version:
First Monday =
MINX (
    FILTER (
        ALL ( 'Table' ),
        FORMAT ( [Date], "mm/yyyy" ) = FORMAT ( MAX( 'Table'[Date] ), "mm/yyyy" )
            && WEEKDAY ( [Date], 2 ) = 1
    ),
    [Date]
)

Result:

9.PNG

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hola Xiaoxin Sheng,

No tengo problemas para identificar el dia de la semana, lo que quiero es que si el primer dia de la demas que comience el domingo o sabado este se considere como parte de la semana en curso y no me considere como una semana aparte por ejemplo el mes de Abril tenemos:

 

Actual 

01/04/2017 -  SEMANA 01 (Domingo)

02/04/2017 -  SEMANA 01 (Sabado)

03/04/2017 -  SEMANA 02 (Lunes)

04/04/2017 -  SEMANA 02 (Martes)

 

Propuesto - Solucion

01/04/2017 -  SEMANA 01  (Domingo)

02/04/2017 -  SEMANA 01  (Sabado)

03/04/2017 -  SEMANA 01  (Lunes)

04/04/2017 -  SEMANA 01  (Martes)

 

 

Espero me puedas ayudar muchas gracias.

Hi @Rommel,

 

>>No tengo problemas para identificar el dia de la semana, lo que quiero es que si el primer dia de la demas que comience el domingo o sabado este se considere como parte de la semana en curso y no me considere como una semana aparte por ejemplo el mes de Abril tenemos

This is the reason why I don't use weeknum function.

Actually, the formula will filter all mondays from similar year month, then return the min one of each date range.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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.