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.
Estoy utilizando la siguiente función para determinar los días laborables, pero necesito que muestre 0 si la fecha de inicio y la fecha de composición es la misma. ¿Cómo puedo hacer esto?
= "(InitialDate as date, FinalDate as date ) como número => #(lf)let#(lf)DaysBetweenDates = Duration.Days(FinalDate-InitialDate),#(lf)DaysList = List.Dates(List.Min({InitialDate,FinalDate}),Number.Abs(DaysBetweenDates)+1, Duration.From(1)),#(lf)WeekDaysList = List.Select(DaysList, cada uno (Date.DayOfWeek(_, Day.Monday) < 5) ), #(lf)WorkingDays = (if DaysBetweenDates < 0 then -1 else 1) * List.Count(WeekDaysList)#(lf)in#(lf)WorkingDays"
Solved! Go to Solution.
Cambie la consulta para que las últimas dos líneas
#WorkingDays = (if DaysBetweenDates < 0 then -1 else 1) * List.Count(WeekDaysList),
Result = if InitialDate - FinalDate = 0 then 0 else #WorkingDays
in
Result
saludos
Phil
Cambie la consulta para que las últimas dos líneas
#WorkingDays = (if DaysBetweenDates < 0 then -1 else 1) * List.Count(WeekDaysList),
Result = if InitialDate - FinalDate = 0 then 0 else #WorkingDays
in
Result
saludos
Phil
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |
User | Count |
---|---|
2 | |
2 | |
2 | |
2 | |
1 |