title: Power BI How to calculate average/stdev of slicer selected items within Date Range?
body: <p>I have a Power BI table looks like this:</p>
  <pre><code>Cat sales   Date
  apple   2.0 03/18/2021
  apple   1.8 03/19/2021
  apple   2.0 03/20/2021
  apple   2.5 03/21/2021
  peach   3.1 03/18/2021
  peach   3.0 03/19/2021
  peach   1.7 03/20/2021
  peach   2.0 03/21/2021
  pear    4.2 03/18/2021
  pear    4.4 03/19/2021
  pear    3.9 03/20/2021
  pear    4.9 03/21/2021
  </code></pre>
  <p>I want to use a date slicer and Cat filter to calculate the (average sales)/(standard deviation of sales) during a period and display in a tile:</p>
  <p>For example:
  Slicer select:  Apple and Pear
  Date Slicer: 03/18/2021 - 03/20/2021
  <a href="https://i.stack.imgur.com/D4150.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/D4150.png" alt="enter image description here" /></a></p>
  <p>Formula:</p>
  <pre><code>Step 1:   Average = (6.2 + 6.2 + 5.9) = 6.1
  03/18/2021   2+4.2= 6.2
  03/19/2021   1.8+4.4 = 6.2
  03/20/2021   2+3.9 = 5.9
  
  Step 2:   Stdev(6.2,6.2,5.9) = 0.1732
  
  Step 3:   Average/Stdev = 6.1/0.1732 = 35.22
  </code></pre>
  <p>Tile display: 35.22</p>
  <p>I am new to DAX and wasn't able to figure out the right formula, Please help!</p>