We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi All,
I want to get difference between two dates excluding weekends, please let me know what could be the formula.
i am pulling data from sharepoint online.
Thanks,
Sarath.
Solved! Go to Solution.
Hi sannadisarath,
According to your description, you want to get a date list between two dates except weekends, right?
If as I said, you can follow below steps:
1. Use CALENDAR function to create a datetable with two dates.
Dax: DateTable = CALENDAR(DATE(2010,1,1),TODAY())
2. Write dax formula to get the specify dates without weekends.
Dax: Date Except Weekends = CALCULATETABLE(DateTable,FILTER(ALL(DateTable), AND(WEEKDAY([Date],1)<> 1,WEEKDAY([Date],1)<> 7))) (Notice: 1 is Sunday, 7 is Saturday)
I added a calculate column to show the day of week.
Reference:
Regards,
Xiaoxin Sheng
Hi,
I created a Date table:
Dim Table=CALENDAR(DATE(2008,1,1),DATE(2018,12,31))
I created a new column with is working day or not
is work day = SWITCH(WEEKDAY([Date]),1,0,7,0,1)
Now I want to create "DateDifference" Column with Createddate & Closeddate (I want to know day diffarence b/w these two dates excluding weekends)
CreatedDate ClosedDate DateDiffarence
Hi sannadisarath,
According to your description, you want to get a date list between two dates except weekends, right?
If as I said, you can follow below steps:
1. Use CALENDAR function to create a datetable with two dates.
Dax: DateTable = CALENDAR(DATE(2010,1,1),TODAY())
2. Write dax formula to get the specify dates without weekends.
Dax: Date Except Weekends = CALCULATETABLE(DateTable,FILTER(ALL(DateTable), AND(WEEKDAY([Date],1)<> 1,WEEKDAY([Date],1)<> 7))) (Notice: 1 is Sunday, 7 is Saturday)
I added a calculate column to show the day of week.
Reference:
Regards,
Xiaoxin Sheng
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 57 | |
| 38 | |
| 33 | |
| 19 | |
| 16 |
| User | Count |
|---|---|
| 68 | |
| 66 | |
| 41 | |
| 34 | |
| 25 |