Forum Discussion

ropathak's avatar
ropathak
Icon for Microsoft Employee rankMicrosoft Employee
5 years ago
Solved

Sum over month from daily data

I have the following data: It has daily data for each month starting from March 20. I want to calculate the monthly sum of sessions. For example, total number of sessions for month of March = ...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi  ropathak ,

    Here are the steps you can follow:

    Create calculated column:

    Sum_Column =
    CALCULATE(SUM('Table'[Session]),
    FILTER('Table',
    YEAR('Table'[Date])=YEAR(EARLIER('Table'[Date]))&&MONTH('Table'[Date])=MONTH(EARLIER(('Table'[Date])))))

    Result:

    Create measure:

    Sum_Measure =
    SUMX(FILTER(ALL('Table'),YEAR('Table'[Date])=YEAR(MAX('Table'[Date]))&&MONTH('Table'[Date])=MONTH(MAX(('Table'[Date])))),'Table'[Session])

    Result:

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly