SQLDAXExcelPython
Leaderboard
Interview classicsMedium20 points

Share of the visible total

Write a measure for each category's share of the sales currently visible. The test query only shows 2024, and the share must add up to 1 within that year.

How your answer is tested

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

EVALUATE
CALCULATETABLE(
    SUMMARIZECOLUMNS(
        Products[Category],
        "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.