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.
Hi Friends,
I read a nice post for calculating the aging or the network days excluding weekends and holidays. But the below DAX is hardcoded with a holiday date. I have a separate table with a list of holiday dates. I dont know how to use my holiday table inside this same query instead of the hardcoded date. Can you please help.
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])
Solved! Go to Solution.
@BI_Analyticz - Just use the name of your separate Holiday table. So if your table is called "My Holidays", your EXCEPT line would be:
VAR Calendar2 = EXCEPT(Calendar1,'My Holidays')
@BI_Analyticz - Just use the name of your separate Holiday table. So if your table is called "My Holidays", your EXCEPT line would be:
VAR Calendar2 = EXCEPT(Calendar1,'My Holidays')
@Greg_Deckler I think the solution is not working my live data. I have extracted the sample and tried the code. But the network days are completely showing as 1 for all the dates. I have the PBIX file in the below link. Can you please have a look.
Also I am using max(CreatedDate) and Today() in the calendar line of the code. If I am using Max(createddate) and Max(ResolvedDate) it is throwing error message as Resolved Date column has blank or no dates for the open tickets. Is there any ideas to ignore or overcome this error if I use the ResovledDate column in the calendar line.
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 |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |