Skip to main content

Practical Challenge Questions 1 DAX

Table of Contents

In a scenario where the Date table spans from January 1, 2020, to December 31, 2022, and the Sales table contains data from January 1, 2020, to November 30, 2022, with the Sales table connected to the Date table based on the date column (and the Date table marked as the primary Date Table).

If I create a new measure called Sales MTD using the formula CALCULATE([Net], DATESMTD('Date'[Date])) and display it on a card visual without any filters or slicers, for which month will the Sales MTD measure show its value?

Answer

The DATESMTD function looks at the last available date within the current context. If no date is provided in the visual or filter, it defaults to the last date in the column specified within the function. In this case, the last date is December 31, 2022. As a result, the Sales MTD measure will display data from December 1, 2022, to December 31, 2022. However, since the Sales table does not have data for this date range, the measure will return a blank result.

Add comment