Forum Discussion
Day Count Business Days Between Two Dates
- 8 years ago
I intended it as a measure.
The culprit is this statement:
Business Day Value = if('Date'[DayOfWeek]="Monday"||
'Date'[DayOfWeek]="Tuesday"||
'Date'[DayOfWeek]="Wednesday"||
'Date'[DayOfWeek]="Thursday"||
'Date'[DayOfWeek]="Friday",
"1",
"0")This statement results in a string of either "1" or "0". Change this to:
Business Day Value = if('Date'[DayOfWeek]="Monday"|| 'Date'[DayOfWeek]="Tuesday"|| 'Date'[DayOfWeek]="Wednesday"|| 'Date'[DayOfWeek]="Thursday"|| 'Date'[DayOfWeek]="Friday", 1, 0)and make sure that the Business Day Value column in your calendar table is of type Whole Number. That should do it.
I used DateColumn since I could not know what name you had chosen for your date column in your calendar. So, replace 'Date'[DateColumn] with 'Date'[Date].
Thanks for the continued help...This is the most recent result.
Int neither works a s a Measure or Column, not sure whoch it should be.
Any suggestions?
- erik_tarnvik8 years ago
Solution Specialist
I intended it as a measure.
The culprit is this statement:
Business Day Value = if('Date'[DayOfWeek]="Monday"||
'Date'[DayOfWeek]="Tuesday"||
'Date'[DayOfWeek]="Wednesday"||
'Date'[DayOfWeek]="Thursday"||
'Date'[DayOfWeek]="Friday",
"1",
"0")This statement results in a string of either "1" or "0". Change this to:
Business Day Value = if('Date'[DayOfWeek]="Monday"|| 'Date'[DayOfWeek]="Tuesday"|| 'Date'[DayOfWeek]="Wednesday"|| 'Date'[DayOfWeek]="Thursday"|| 'Date'[DayOfWeek]="Friday", 1, 0)and make sure that the Business Day Value column in your calendar table is of type Whole Number. That should do it.