Forum Discussion
Anonymous
4 years agoNot applicable
Excluding friday between two date range
Anonymous Anonymous Hi, I have been scratching my heads since many days. I have a file with three coloums, SR_CREATION_DATE,Last_Update_Date, SR_Status My problem is I need to calculate the da...
- 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)))
Anonymous
4 years agoNot applicable
thanks Anonymous Created a new coloumn to using int function to extract the date and rest is your formulae. thanks a lot.
edhans
4 years agoCommunity Champion
Hi Anonymous , While Anonymous does work without a date table, I provided a date table in the example I shared, and did so for a reason. if you have any dates in your model, you need a data table. Best practice. Power BI DAX simply becomes a mess if you do too much without a date table, as can be seen by the length of the DAX code I provided and the one where you have to create a virtual date table. It compounds if you do that to many columns or measures.