Depending on the version of Analysis Services you are using, you can use one of the following queries to gather usage information:
- For SQL Server 2016 and later versions (Tabular Models):
SELECT
[CUBE_NAME] AS CubeName,
[OBJECT_NAME] AS ObjectName,
[QUERY_START_TIME] AS QueryStartTime,
[ELAPSED_TIME] AS ElapsedTime
FROM $SYSTEM.DISCOVER_SESSIONS
WHERE [SESSION_START_TIME] >= DATEADD(MONTH, -1, GETDATE())
AND [OBJECT_TYPE] = 'SESSION_CUBE'
ORDER BY [QUERY_START_TIME] DESC
This query retrieves information about the sessions and queries executed on the Tabular Cube in the last month. It provides details such as the Cube name, Object name (specific table or calculation), Query start time, and Elapsed time.
- For earlier versions of Analysis Services (Multidimensional Models):
SELECT
[CUBE_NAME] AS CubeName,
[SESSION_ID] AS SessionID,
[REQUEST_COMMAND] AS RequestCommand,
[START_TIME] AS StartTime,
[ELAPSED_TIME] AS ElapsedTime
FROM $SYSTEM.DISCOVER_SESSIONS
WHERE [START_TIME] >= DATEADD(MONTH, -1, GETDATE())
AND [REQUEST_TYPE] = 1 -- MDX Query
AND [CUBE_NAME] = 'YourCubeName'
ORDER BY [START_TIME] DESC