Forum Discussion

LeaRupnik's avatar
LeaRupnik
Helper III
6 years ago
Solved

sum column

Hello,  a have a problem, how to sum the sum column.  i have a exemple, a wont a sum column sum witch is sum jan in feb  and a get 1+2 = 3 then 3+3 = 6 then 6+4 = 10,....   date number sum ...
  • Icey's avatar
    Icey
    6 years ago

    Hi LeaRupnik ,

    Try this:

    1. Create a Calendar table.

    Calendar = CALENDAR ( DATE ( 2019, 1, 1 ), DATE ( 2019, 12, 31 ) )

    2. Create columns in Calendar table.

    Month = MONTH('Calendar'[Date])
    Month Name = FORMAT('Calendar'[Date],"mmm")

    3. Create relationship.

    4. Create measures.

    MTD = TOTALMTD(SUM('Table'[quantiti]),'Calendar'[Date])
    YTD =
    IF (
        NOT ( ISBLANK ( MAX ( 'Table'[quantiti] ) ) ),
        TOTALYTD ( SUM ( 'Table'[quantiti] ), 'Calendar'[Date] )
    )

    PBIX file attached.

     

    Best Regards,

    Icey

     

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