question

BhanuJyothi avatar image
BhanuJyothi asked

Passing Date parameter to Mdx query filter in ssrs

I have one Dataset which has a Date filter and I filter it with LastPeriods(12,STRTOMEMBER('[Date].[Date].'+Format(Now(),'[yyyy].&[MM]'))) filter, which filters the date to last 12 months from present month. But now I need to get the values for date from a column where months are dynamically generated from a query, that is Suppose there is a month july 2016 in a row, It should filter the date to 12 months till july 2016 and display the dateset value with that filter in the repective row where july 2016 is present. Can you suggest any way to do that
mdxreportingreporting_servicesreport-builder
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Oleg avatar image Oleg commented ·
@BhanuJyothi It is hard to tell without knowing the details, but have you tried using the **CurrentMember** of whatever calendar hierarchy you have. Every calculation in MDX is always in the context of the applied filters (if any), so that if you have, say, month on the row and need to calculate, say, sales for rolling 12 months then the **CurrentMember** of the date hierarchy should be available for every such row. There will be no need to apply the **strtomember** though because the **CurrentMember** can be brought to the same level and it is already derived from date value at the end of the day.
0 Likes 0 ·

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.