title: How to find last date with sales starting from yesterday with DAX
body: <p>I have a calculated column &quot;LastSaleDate&quot; that finds the last date with sales with the following dax expression:
  LastSaleDate=LASTDATE(filter(ALL(Dim_Time[Date]),[Sales Amount] &gt;0))</p>
  <p>What I want to achieve next is to create another calculated column &quot;LastSaleDateStartingFromYesterday&quot;. So for example if the current date is Monday and there are no sales on Sunday or Saturday it should return Friday as the last date with sales (See example below). It is possible that Saturday and Sunday have Sales so I cannot exlude/filter them out.</p>
  <p>How to write such a dax expression ?</p>
  <p><a href="https://i.stack.imgur.com/cyyzM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cyyzM.png" alt="enter image description here" /></a></p>
  <p>All tips, solutions and help are highly appreciated</p>
  <p>Best regards, Rubrix</p>