For others who have the same problem, and are after the excel kind of effect, where the dimension of the user hierarchy is only expanded for parents, this is the way to do it:
WITH
MEMBER [Measures].[Test] AS
0
SELECT
{
[Test]
} ON 0,
NON EMPTY {
filter (
{[dim user].[userhierarchy].[userlevel1].allmembers }
,[dim user].[userhierarchy].currentmember.children.count > 1
),
filter (
{[dim user].[userhierarchy].[userlevel2].allmembers }
,[dim user].[userhierarchy].currentmember.children.count > 1
),
filter (
{[dim user].[userhierarchy].[userlevel3].allmembers }
,[dim user].[userhierarchy].currentmember.children.count > 1
),
filter (
{[dim user].[userhierarchy].[userlevel4].allmembers }
,[dim user].[userhierarchy].currentmember.children.count > 1
),
filter (
{[dim user].[userhierarchy].[userlevel5].allmembers }
,[dim user].[userhierarchy].currentmember.children.count > 1
),
filter (
{[dim user].[userhierarchy].[userlevel6].allmembers }
,[dim user].[userhierarchy].currentmember.children.count > 1
),
filter (
{[dim user].[userhierarchy].[userlevel7].allmembers }
,[dim user].[userhierarchy].currentmember.children.count > 1
),
filter (
{[dim user].[userhierarchy].[userlevel8].allmembers }
,[dim user].[userhierarchy].currentmember.children.count > 1
),
filter (
{[dim user].[userhierarchy].[userlevel9].allmembers }
,[dim user].[userhierarchy].currentmember.children.count > 1
),
filter (
{[dim user].[userhierarchy].[userlevel10].allmembers }
,[dim user].[userhierarchy].currentmember.children.count > 1
)
} ON 1
FROM [Activities]
The query will automatically check the user hierarchy, and go down to the necessary levels automatically. Thanks to Bill for suggesting his solution and putting me on the right track.