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.
Hello,
I'm still a new on Power BI and I looking for a solution everywhere but I didn't found the answer.
My problem is: I need to calculate the difference of hours between two dates, but the thing is that I need to calculate only the working days (without weekends and bank holiday).
I already have this table:
Can somebody help me? Please
Best Regards
Lore
Check out my Net Work Days Quick Measure:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Net-Work-Days/m-p/367362
Hello @Greg_Deckler,
Thank you for your answer. But I have already seen your solution and I would like this
NetWorkDaysHoursMinutes
and this
NetWorkDaysHolidays =
VAR Calendar1 = CALENDAR(MAX(NetWorkDays[created date]),MAX(NetWorkDays[review date]))
//VAR Holidays = DATATABLE("Date",DATETIME,{{}})
VAR Holidays1 = DATATABLE("Date",DATETIME,
{
{"12/25/2017 12:00:00 AM"}
})
VAR Calendar2 = EXCEPT(Calendar1,Holidays1)
VAR Calendar3 = ADDCOLUMNS(Calendar2,"WeekDay",WEEKDAY([Date],2))
RETURN COUNTX(FILTER(Calendar3,[WeekDay]<6),[Date])
in the same formula.
Thank you again
Best regards,
Lore
Well, you just combine the formulas then:
NetWorkDaysHolidaysDaysHoursMinutes = VAR Calendar1 = CALENDAR(MAX(NetWorkDays[created date]),MAX(NetWorkDays[review date])) VAR Holidays1 = DATATABLE("Date",DATETIME, { {"12/25/2017 12:00:00 AM"} }) VAR Calendar2 = EXCEPT(Calendar1,Holidays1) VAR Calendar3 = ADDCOLUMNS(Calendar2,"WeekDay",WEEKDAY([Date],2)) RETURN COUNTX(FILTER(Calendar3,[WeekDay]<6),[Date]) & " Days " & HOUR(MOD(MAX(NetWorkDays[review date]) - MAX(NetWorkDays[created date]),1))
& " Hours " & MINUTE(MOD(MAX(NetWorkDays[review date]) - MAX(NetWorkDays[created date]),1)) & " Minutes"Red is from NetWorkDaysHolidays, Orange is from NetWorkDaysHoursMinutes and Green are tweaks. I did notice there is an error in the formula so I am correcting that.
Red is from NetWorkDaysHolidays, Orange is from NetWorkDaysHoursMinutes and Green are tweaks. I noticed that there is actually an error in the NetworkDAysHoursMinutes formula so I corrected that and will correct it in the original post as well.
I corrected the formula and posted the new formula as well to the Quick Measure gallery.
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 |
---|---|
112 | |
100 | |
76 | |
74 | |
49 |
User | Count |
---|---|
146 | |
108 | |
106 | |
90 | |
62 |