Replace 替换mdx中的空字段

Replace 替换mdx中的空字段,replace,mdx,ssas-tabular,Replace,Mdx,Ssas Tabular,在这种情况下,一列中有一个空值,需要用另一个值替换该值 当前mdx select non empty { [measures.[Color count]} on columns ,non empty { [ColorColor].[Color].[Color].allmembers} Dimention properties member caption ,member_unique_name on rows from [Colors] 当前结果 预期结果 基本上我需要用银色来替换空值。此外,

在这种情况下,一列中有一个空值,需要用另一个值替换该值

当前mdx

select
non empty { [measures.[Color count]} on columns
,non empty { [ColorColor].[Color].[Color].allmembers}
Dimention properties
member caption
,member_unique_name
on rows
from [Colors]
当前结果

预期结果

基本上我需要用银色来替换空值。此外,还需要在mdx中而不是在ssrs中替换null。

使用WITH MEMBER,您可以创建一个新项目,给它任何您想要的名称,并告诉它从null项目获取其值。然后可以使用EXCEPT函数的第二个参数隐藏不需要的项

with member [ColorColor].[Color].[Color].[MyNewName] 
AS [ColorColor].[Color].[Color].[null]
select
non empty { [measures.[Color count]} on columns
,non empty { 
[ColorColor].[Color].[Color].[MyNewName],
EXCEPT({[ColorColor].[Color].[Color].allmembers},{[ColorColor].[Color].[Color].[null]})
}
Dimention properties
member caption
,member_unique_name
on rows
from [Colors]
Color     Color Count
Silver    1
Red       1
Blue      1
Purple    1
Black     1
with member [ColorColor].[Color].[Color].[MyNewName] 
AS [ColorColor].[Color].[Color].[null]
select
non empty { [measures.[Color count]} on columns
,non empty { 
[ColorColor].[Color].[Color].[MyNewName],
EXCEPT({[ColorColor].[Color].[Color].allmembers},{[ColorColor].[Color].[Color].[null]})
}
Dimention properties
member caption
,member_unique_name
on rows
from [Colors]