Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Cumulative total based on column type

Hello,

I am trying to create line and clustered column chart

The line  line graph will be the cumulative total  by Type (budget, forecast) .

How to do I calcuate two cumulative total , one for budget, another for Forecast. 

 I have table design like this :

Team, Type, Months, Value, MonthSort 

S         Budget     1       100    1

S         Forecast   1       500     1

 

Thank you for your help

  • Hi Anonymous 

    Create Measures

    Measure =
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Type]
                = MAX ( 'Table'[Type] )
                && 'Table'[date]
                    <= MAX ( 'Table'[date] )
        )
    )
    
    or
    
    Measure 2 =
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Type]
                = MAX ( 'Table'[Type] )
                && 'Table'[MonthSort]
                    <= MAX ( 'Table'[MonthSort] )
        )
    )
    
    

     

    Best Regards
    Maggie
    Community Support Team _ Maggie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 Replies