Forum Discussion
Excluding friday between two date range
- Anonymous4 years ago
Hi Anonymous
Following edhans logic, if you don't have a Date table, create a virtual one
TAT1 = VAR Dates=ADDCOLUMNS(CALENDAR(MIN('Table'[SR_CREATION_DATE]),TODAY()),"weekday",WEEKDAY([Date])) RETURN IF([SR_Status]="Closed", COUNTROWS(FILTER(Dates,[Date] >= [SR_CREATION_DATE] && [Date] < [Last_Update_Date] && [weekday] <> 5)), COUNTROWS(FILTER(Dates,[Date] >= [SR_CREATION_DATE] && [Date] < TODAY() && [weekday] <> 5)))
If you have a Date table, this is relatively easy. This will work as a calculated column:
ExcludingFridays =
VAR varDateList =
FILTER(
'Date',
'Date'[Date] >= [Date1] && 'Date'[Date] <= [Date2] && 'Date'[Day Name] <> "Friday"
)
RETURN
COUNTROWS(varDateList)
- Anonymous4 years agoNot applicable
the data i am working on is flowing through our database. My source is MySql. Data is related to Service Request and the status is either closed or open . Condition I am looking for is something like
if Sr_status is closed then Start_Date-END_Date minuss fridays in between
else Start_Date-Today() minus fridays in between.
- Anonymous4 years agoNot applicable
Hi Anonymous
Following edhans logic, if you don't have a Date table, create a virtual one
TAT1 = VAR Dates=ADDCOLUMNS(CALENDAR(MIN('Table'[SR_CREATION_DATE]),TODAY()),"weekday",WEEKDAY([Date])) RETURN IF([SR_Status]="Closed", COUNTROWS(FILTER(Dates,[Date] >= [SR_CREATION_DATE] && [Date] < [Last_Update_Date] && [weekday] <> 5)), COUNTROWS(FILTER(Dates,[Date] >= [SR_CREATION_DATE] && [Date] < TODAY() && [weekday] <> 5)))- Anonymous4 years agoNot applicable
thanks, this almost worked buh only problem is difference between below dates is coming as blanks, is it possible to show as 1
19-Dec-2021 3:04:46 and 20-Dec-2021 12:00:00am