Language Translator | DAX

DAX Total Sales by Category in 2022

This DAX query uses SUMMARIZECOLUMNS to group sales by product category, summing the amounts for 2022 from the Sales table.


Empty image or helper icon

Prompt

SUMMARIZECOLUMNS(
    'Product'[Category],
    "Total Sales", SUM('Sales'[Amount]),
    FILTER(ALL('Calendar'), 'Calendar'[Year] = 2022)
)

Answer

EVALUATE
SUMMARIZECOLUMNS(
    'Product'[Category],
    "Total Sales", SUM('Sales'[Amount]),
    FILTER(ALL('Calendar'), 'Calendar'[Year] = 2022)
)

The provided code snippet has been successfully translated into DAX. The SUMMARIZECOLUMNS function retains the original structure with 'Product'[Category] as the grouping column, "Total Sales" with the sum of 'Sales'[Amount], and a filter condition to include only the year 2022 from the 'Calendar' table. The translation preserves the logic and behavior of the original code while adhering to DAX best practices.

Create your Thread using our flexible tools, share it with friends and colleagues.

Your current query will become the main foundation for the thread, which you can expand with other tools presented on our platform. We will help you choose tools so that your thread is structured and logically built.

Description

This DAX query uses SUMMARIZECOLUMNS to group sales by product category, summing the amounts for 2022 from the Sales table.