Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
pagedrop
New Member

adding a FILTER function, using an inclusive range in a subselect

here is my current code and im very new to MDX and playing ard.

 

SELECT NON EMPTY { [Measures].[Affiliations Count], [Measures].[Practitioners Count] } ON COLUMNS,

 NON EMPTY { ([Associations].[Network].[Network].ALLMEMBERS * [Associations].[Health Plan].[Health Plan].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS

 

 FROM ( SELECT ( STRTOSET("[All]", CONSTRAINED) ) ON COLUMNS

 FROM ( SELECT ( { [Associations].[Record Type].&[Practitioner] } ) ON COLUMNS

 FROM ( SELECT ( -{ [Associations].[Health Plan].&[] } ) ON COLUMNS

 FROM ( SELECT ( { [Affiliations].[Affiliation Par].&[True] } ) ON COLUMNS

 FROM ( SELECT ( { [Affiliations].[Affiliation Incomplete].&[False] } ) ON COLUMNS

 FROM ( SELECT ( { [Affiliations].[Affiliation Active].&[True] } ) ON COLUMNS

 FROM [FusionCore]))))))

 

 WHERE ( [Affiliations].[Affiliation Active].&[True],

 [Affiliations].[Affiliation Incomplete].&[False],

 [Affiliations].[Affiliation Par].&[True],

 [Associations].[Record Type].&[Practitioner],

 

IIF( STRTOSET("[All]", CONSTRAINED).Count = 1, STRTOSET("[All]", CONSTRAINED), [Associations].[Corporate Plan].currentmember ) )

 CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS

 

I have been trying to add a filter funtion or date range in subselect, but not able to achieve or get what i want.

How can I add a line to handle a date range from today through 30 days from now forward? 

 

1 ACCEPTED SOLUTION
v-sihou-msft
Microsoft Employee
Microsoft Employee

@pagedrop

 

You just need to use STRTOMEMBER() with Now() function to get the date member for today, then apply the date range as subselect in your MDX.

 

I have replied the thread you posted on MSDN forum: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/45f744ff-6400-45fc-bbce-93a8c0f9e8f7/adding...

 

Regards,

View solution in original post

1 REPLY 1
v-sihou-msft
Microsoft Employee
Microsoft Employee

@pagedrop

 

You just need to use STRTOMEMBER() with Now() function to get the date member for today, then apply the date range as subselect in your MDX.

 

I have replied the thread you posted on MSDN forum: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/45f744ff-6400-45fc-bbce-93a8c0f9e8f7/adding...

 

Regards,

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.