I already had an MDX query that returns number of days in a Month Hierarchy using a calculated member. What I needed to do is to add new calculated member that returns number of days excluding weekends (Saturdays and Sundays).
Below is my existing MDX query using Adventure Works DW 2008R2 SE
WITH
MEMBER [Measures].[Num of Days] AS
COUNT (
Descendants ( [Date].[Calendar], [Date].[Calendar].[Date])
)
SELECT
{ [Measures].[Num of Days] } ON COLUMNS,
[Date].[Calendar].[Month].ALLMEMBERS ON ROWS
FROM [Adventure Works]
sample existing output:
+----------------+-------------+
| Month Year | Num of Days |
+----------------+-------------+
| July 2005 | 31 |
| August 2005 | 31 |
| September 2005 | 30 |
+----------------+-------------+
sample expected output:
+----------------+-------------+--------------------------------+
| Month Year | Num of Days | Num of Days Excluding Weekends |
+----------------+-------------+--------------------------------+
| July 2005 | 31 | 21 |
| August 2005 | 31 | 23 |
| September 2005 | 30 | 22 |
+----------------+-------------+--------------------------------+