cancel
Showing results 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.

Frequent Visitor

## Tercer día laborable del mes siguiente

Hola,
Una pregunta sencilla, ¿Cómo calculo en DAX el tercer día laborable del mes siguiente (usando today) excluyendo los fines de semana?

Entiendo que debería usar un NetworkDays pero no encuentro la solucion.

1 ACCEPTED SOLUTION

``````Third Business Day =
VAR __EOM = EOMONTH(TODAY(), 1)
VAR __Start = DATE( YEAR( __EOM ), MONTH( __EOM ), 1 )
VAR __End = __Start + 4
VAR __Calendar =
CALENDAR( __Start, __End ),
"__Day", WEEKDAY( [Date], 2 )
),
"__IsWeekDay", IF([__Day]<6, 1, 0)
)
VAR __Calendar1 =
__Calendar,
"__Count",
VAR __Date = [Date]
VAR __Result = IF( [__IsWeekDay] = 0, 0, COUNTROWS(FILTER(__Calendar, [Date] <= __Date && [__IsWeekDay] = 1)))
RETURN
__Result
)
VAR __Result = MAXX(FITLER(__Calendar1, [__Count] = 3), [Date])
RETURN
__Result``````
2 REPLIES 2

Tal vez pueda probar la siguiente fórmula de medición:

``````NextMonthThirdBusinessDay =
VAR CurrentDate =
TODAY ()
VAR FirstDayNextMonth =
EOMONTH ( CurrentDate, 0 ) + 1
SWITCH (
WEEKDAY ( FirstDayNextMonth ),
1, FirstDayNextMonth + 2,
// If Sunday, add 2 days
2, FirstDayNextMonth + 2,
// If Monday, add 2 days
3, FirstDayNextMonth + 1,
// If Tuesday, add 1 day
4, FirstDayNextMonth + 1,
// If Wednesday, add 1 day
5, FirstDayNextMonth + 1,
// If Thursday, add 1 day
6, FirstDayNextMonth + 3,
// If Friday, add 3 days
FirstDayNextMonth + 3 // If Saturday, add 3 days
)
RETURN

Saludos

Si esta publicación ayuda, considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

``````Third Business Day =
VAR __EOM = EOMONTH(TODAY(), 1)
VAR __Start = DATE( YEAR( __EOM ), MONTH( __EOM ), 1 )
VAR __End = __Start + 4
VAR __Calendar =
CALENDAR( __Start, __End ),
"__Day", WEEKDAY( [Date], 2 )
),
"__IsWeekDay", IF([__Day]<6, 1, 0)
)
VAR __Calendar1 =
__Calendar,
"__Count",
VAR __Date = [Date]
VAR __Result = IF( [__IsWeekDay] = 0, 0, COUNTROWS(FILTER(__Calendar, [Date] <= __Date && [__IsWeekDay] = 1)))
RETURN
__Result
)
VAR __Result = MAXX(FITLER(__Calendar1, [__Count] = 3), [Date])
RETURN
__Result``````

Announcements

#### 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

#### Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

#### Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors