Forum Discussion

DanCasSan's avatar
DanCasSan
Icon for Helper V rankHelper V
6 years ago
Solved

Cumulative sum for month

Hello community! I'm trying to perform a cumulative summation in PowerBi, but, I still can't solve it. Basically, I need to show my data as in the image attached. The calculation to be carried out is...
  • Ashish_Mathur's avatar
    6 years ago

    Hi,

    Try this

    1. Create a Calendar Table.  Write the following calculated column formulas to extract the Year and Month Number.  Year = Year(Calendar[Date]) and Month = Month(Calendar[Date])
    2. Create a relationship (Many to One, Single) from the Date column of your base data table to the Date column of your Calendar Table
    3. To your matrix visual, drag Month to the row labels and Year to the column labels
    4. Write this measure to compute yearly sales. Sales = SUM(Data[Sale])
    5. Write this measure to compute Cumulative sales.  Cumulative sales = CALCULATE([Sales],DATESYTD(Calendar[Date],"31/12"))

    Hope this helps.