Get total sum for each month in DAX
<p>I have a tabular mode analysis server connected to a sql server database. I want to get the total x per month, and I have the total x per day. So for example, I have a table DailyEvent with the first 2 columns like this, and I want the column "MonthXCount":</p>

<pre><code>TimeID   XCount MonthXCount
20160429  3          11
20160430  8          11
20160501  4           4
</code></pre>

<p>So the total XCount for April is 11, so for every day in April I want 11. The total X count for may is 4 (so far).</p>

<p>What I have now is a MonthToDate total I think, calculated as:</p>

<pre><code>=TOTALMTD(SUM('DailyEvent'[XCount]),'DailyEvent'[TimeID])
</code></pre>

<p>But I want to then have a column that puts the last value of the month in for every day of the month.</p>

<p>The end goal is to have a XCount by month graph in PowerBI, so I might not need to add the column here... I might be able to just tell PowerBi to graph the last day of the month, but I'm not sure how to do that and thought this would be easier.</p>