'Cumilative Total for end of each month

I am new to dax . I am trying to get the cumulative sales total for end of each month.

I have created a measure that calculates total sales called "MeasureTotalSum" MeasureTotalSum = Sum(FactSales[SaleAmount])

Then I have used that below,

Sales:=CALCULATE ( [MeasureSalesSum], FILTER ( ALL ( DimDate[Datekey] ), DimDate[Datekey] <= MAX ( ( DimDate[Datekey] ) ) ) )

But i am not able to get sum of MeasureTotalSum at the end of each month.(I need sum of MeasureTotalSum for last day of every month )

Example : value @ Jan31 + Feb28 +March31 + Jume30 ......Dec31 for every year.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source