SQLDAXExcelPython
Leaderboard
Time intelligenceMedium20 points

Previous month sales

Write a measure that returns [Total Sales] for the previous month.

How your answer is tested

Your code becomes a measure named [Answer] and runs in this query:

EVALUATE
CALCULATETABLE(
    SUMMARIZECOLUMNS(
        'Calendar'[MonthNumber],
        "Answer", [Answer]
    ),
    'Calendar'[Year] = 2024
)
Show solutionLifetime

Runs in your browser. The open-source dax-sql compiler turns DAX into SQL, so this isn't Microsoft's engine. The questions here were checked against Power BI Desktop, but free-form queries can occasionally differ.

DAX measure
Loading editor…

Press Ctrl+Enter or Run to see the result here.