Cumulative Totals Not Working-

@krish1712,

Nice job on the revision. You were soooo close - your cumulative totals were actually correct, but just looked wrong because you had your row headers sorted incorrectly. When you sort MonthName by MonthOfYear, It all snaps into place:

P.S. If you don’t mind, can I make a suggestion that I guarantee will serve you well as you progress with Power BI - learn to format your DAX, and do it on every measure that you write.

Look how much simpler it is to read and understand this measure formatted versus unformatted:

Cumulative Sales = 

CALCULATE(
    [Total Sales], 
    FILTER(
        ALLSELECTED( 'Date' ), 
        'Date'[Date] <= MAX('Date'[Date] )
    )
)

Cumulative Sales = CALCULATE([Total Sales], FILTER(ALLSELECTED(‘Date’), ‘Date’[Date]<=MAX(‘Date’[Date])))

And as you start writing more complex measures with variables, virtual tables, etc. the difference gets even more pronounced, and at least IMO understanding and debugging a complex unformatted measure is 10 times harder than doing the same thing for a formatted one. Daxformatter.com is a terrific site that will automatically format your DAX measures. It’s a great learning tool, but once you get used to formatting as you write measures, you’ll find that you rarely use or need it anymore.

1 Like