Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Drawing the graph for cumulative sum data

Below is dax for cumulative sales sum which is grouped by 'SBU name' and 'month'   Cumulative Sales_Blank = if('2-3-1_BIS_WorkingDay_mKRW_Each BU'[Date]<=today(),CALCULATE(SUM('2-3-1_BIS_WorkingDa...
  • v-juanli-msft's avatar
    v-juanli-msft
    7 years ago

    Hi Anonymous 

    When i create a calcuated column like this (not measure)

    Cumulative Sales_Blank =
    IF (
        [date]
            <= CALCULATE (
                LASTDATE ( Sheet5[date] ),
                FILTER ( Sheet5, ISBLANK ( Sheet5[sales_mkrw] ) = FALSE () )
            ),
        CALCULATE (
            SUM ( [sales_mkrw] ),
            FILTER (
                Sheet5,
                [sbu_name] = EARLIER ( Sheet5[sbu_name] )
                    && [date] <= EARLIER ( [date] )
                    && FORMAT ( Sheet5[date], "yyyymm" )
                        = FORMAT ( EARLIER ( Sheet5[date] ), "yyyymm" )
            )
        )
    )
    

    It works correctly on my side.

    I change the X type to categorical, add "date" from the a date table which is connected to my Sheet5.

    You could download my pbix to see what i have done and see difference with yours.

     

    Best Regards

    Maggie