Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.