Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
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.
Solved! Go to Solution.
@Syndicate_Admin Quizás:
Third Business Day =
VAR __EOM = EOMONTH(TODAY(), 1)
VAR __Start = DATE( YEAR( __EOM ), MONTH( __EOM ), 1 )
VAR __End = __Start + 4
VAR __Calendar =
ADDCOLUMNS(
ADDCOLUMNS(
CALENDAR( __Start, __End ),
"__Day", WEEKDAY( [Date], 2 )
),
"__IsWeekDay", IF([__Day]<6, 1, 0)
)
VAR __Calendar1 =
ADDCOLUMNS(
__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
Hola @Syndicate_Admin ,
Tal vez pueda probar la siguiente fórmula de medición:
NextMonthThirdBusinessDay =
VAR CurrentDate =
TODAY ()
VAR FirstDayNextMonth =
EOMONTH ( CurrentDate, 0 ) + 1
VAR ThirdBusinessDay =
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
ThirdBusinessDay
Saludos
Adamk Kong
Si esta publicación ayuda, considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
@Syndicate_Admin Quizás:
Third Business Day =
VAR __EOM = EOMONTH(TODAY(), 1)
VAR __Start = DATE( YEAR( __EOM ), MONTH( __EOM ), 1 )
VAR __End = __Start + 4
VAR __Calendar =
ADDCOLUMNS(
ADDCOLUMNS(
CALENDAR( __Start, __End ),
"__Day", WEEKDAY( [Date], 2 )
),
"__IsWeekDay", IF([__Day]<6, 1, 0)
)
VAR __Calendar1 =
ADDCOLUMNS(
__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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.