Forum Discussion

GAURAV7781's avatar
GAURAV7781
Icon for Helper III rankHelper III
6 years ago
Solved

How can i get cumulative total for below data using dax

Sample Data 

Dear Sir 

 I have created cumulation dax,

Actual Cumulative COl = 
CALCULATE(Sum('Cumulative Test'[Actual]),FILTER(ALLEXCEPT('Cumulative Test','Cumulative Test'[Location]),'Cumulative Test'[MY] <= Earlier('Cumulative Test'[MY] )))

 

Every time i use this dax, It cumulates from month 1, 

but i want cumulation to start from month 4 Q1,

dax 

  •  
    First, do you have a real date column in your table?  If there is no difference between your fact data and the data you provide in data type, please try the following steps:
    1. Create an index column in "edit queries" as a filter condition for cumulative value
    2. DAX
    Actual Cumulative =
    IF (
        NOT ( ISBLANK ( 'Cumulative Test'[Actual] ) ),
        CALCULATE (
            SUM ( 'Cumulative Test'[Actual] ),
            FILTER (
                ALLEXCEPT ( 'Cumulative Test', 'Cumulative Test'[Location] ),
                'Cumulative Test'[Index] <= EARLIER ( 'Cumulative Test'[Index] )
            )
        )
    )
     
    You can also refer to the pbix
     
     
    Best Regards,
    Liang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 Replies