title: Charting average sales per weekday on data composed of hours
body: <p>I'm using PowerBI desktop and I'm creating a chart to display <strong>average sales per weekday</strong>:</p>
  
  <p><a href="https://i.stack.imgur.com/3Oa61.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3Oa61.png" alt="enter image description here"></a></p>
  
  <p>My data is in the format below:</p>
  
  <p><em>(sampled in Excel to remove sensitive information, added colors to facilitate visualization)</em></p>
  
  <p><a href="https://i.stack.imgur.com/jOBGj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jOBGj.png" alt="sample_data"></a></p>
  
  <p><strong>My problem is</strong>: since each day is broken in 24 rows (hours), my average is wrong by a factor of 24.</p>
  
  <p>For example, if I select January-2019 in the slicer, which has five Tuesdays (weekday code: 2), I want to see on the bar number 2:</p>
  
  <ul>
  <li><strong>(sum of amount where weekday = 2) / 5</strong></li>
  </ul>
  
  <p>Instead, I'm calculating:</p>
  
  <ul>
  <li><strong>(sum of amount where weekday = 2) / (24 * 5)</strong></li>
  </ul>
  
  <hr>
  
  <p>I can think of some ways to get this right, but they involve custom columns or auxiliary tables. I'm sure there is a simpler answer using DAX and measures, but I'm still learning it. </p>
  
  <p>How can I correctly calculate this?</p>