SSRS month labeling (MDX dataset)

SSRS Switch Example (within expression) using MDX dataset.

In my case, the parameter dataset (MDX) doesn’t have a nice label for @Month:
@Month.Value = [Time].[Fiscal Month].&[2010-01-01T00:00:00]
@Month.Label = 2010-01-01 00:00:00

So I’m using a switch to project the name of the month on my report.

=Switch(
MONTH(CDATE(Parameters!Month.Label))=1,”January”,
MONTH(CDATE(Parameters!Month.Label))=2,”February”,
MONTH(CDATE(Parameters!Month.Label))=3,”March”,
MONTH(CDATE(Parameters!Month.Label))=4,”April”,
MONTH(CDATE(Parameters!Month.Label))=5,”May”,
MONTH(CDATE(Parameters!Month.Label))=6,”June”,
MONTH(CDATE(Parameters!Month.Label))=7,”July”,
MONTH(CDATE(Parameters!Month.Label))=8,”August”,
MONTH(CDATE(Parameters!Month.Label))=9,”September”,
MONTH(CDATE(Parameters!Month.Label))=10,”October”,
MONTH(CDATE(Parameters!Month.Label))=11,”November”,
MONTH(CDATE(Parameters!Month.Label))=12,”December”
)

For “January 2010”, just use:
MONTH(CDATE(Parameters!Month.Label))=1,
(“January “+CSTR(YEAR(CDATE(Parameters!Month.Label)))),

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s