Paging in DAX using “Start At”

If you want to use paging in your DAX query you can do this by using the “Start At” parameter in “Summarize”.

Here is a sample on how this can be done:

EVALUATE
SUMMARIZE (
'Date',
'Date'[Month Name],
'Date'[Calendar Year],
"Sales", 'Internet Sales'[Internet Total Sales]
)
ORDER BY 'Date'[Calendar Year]
START AT 2007

The code above will give sales per year per month starting at the year of 2007. Please note that this also returns empty rows. In the next sample we remove the blank rows and extend our “Start At” to also handle month names.

EVALUATE
FILTER (
SUMMARIZE (
'Date',
'Date'[Month Name],
'Date'[Calendar Year],
"Sales", 'Internet Sales'[Internet Total Sales]
),
'Internet Sales'[Internet Total Sales] <> 0
)
ORDER BY 'Date'[Calendar Year], 'Date'[Month Name]
START AT 2007,
"July"

This query will give sales per year per month for year later than 2007 and month name later than july. Blank rows will also be removed using the filter function.

Advertisements