Finding the last date with data

In this recipe, we are going to learn how to find the last date with data for a particular combination of members in the cube. We will start with a general calculation, not dependent on the time context, and later show how to make it time-sensitive, if required.

Getting ready

Open SQL Server Data Tools (SSDT) and then open Adventure Works DW 2016 solution. Double-click on the Date dimension found in the Solution Explorer. Select the Date attribute and locate the property ValueColumn at the bottom of the Properties pane:

Getting ready

There is a value in that property. Column FullDateAlternateKey, of the DataType, is specified as ...

Get MDX with Microsoft SQL Server 2016 Analysis Services Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.