title: How to calculate number of Saturday's Sunday's (Business Days) in a month in AWS QuickSight
body: <p>I tried the below logic in calculated fields of QuickSight analyses section but sometimes it fails.</p>
  <pre><code>WeekdayStart = extract('WD',${FromDate})
  WeekdayEnd   = extract('WD',${ToDate})
  TotalWeeks   = dateDiff(${FromDate},${ToDate},'WK')
  
  Total weekdays =   ifelse(
      WeekdayStart &gt; WeekdayEnd, abs(WeekdayStart-7)+(TotalWeeks*5)+(WeekdayEnd-1),
      WeekdayEnd = 7, abs(WeekdayStart-7)+((TotalWeeks-1)*5)+(WeekdayEnd-2),
      abs(WeekdayStart-7)+((TotalWeeks-1)*5)+(WeekdayEnd-1)
  )
  </code></pre>