0
votes

I need to filter the measure values as

MeasureA   MeasureB
 10          10
 15          15
  5          20
 20          20

Here I need to get only the measures are not equal, I am using filter function as but not working

Select Filter({[Measures].[A], [Measures].[B]}, ([Measures].[A]- [Measures].[B])=0) on 0 from [Cube]

Expected result set

    MeasureA   MeasureB     
     5          20

What am I missing?

2

2 Answers

3
votes

Try using a dimension instead of your measures for the first part of the filter statement. Assuming you are querying products then your query might look like:

select {[Measures].[A],[Measures].[B]} on columns,
filter ({[Products].Members},[Measures].[A] = [Measures].[B]) on rows
from [Sales Cube]
0
votes

You might want to try creating a calculated field in the DSV for this Fact table...

CASE
  WHEN MeasureFieldA != MeasureFieldB THEN 1
  ELSE 0
END

Then you can create a "fact dimension" and have this calculated field as an attribute to be used in your queries or calculated measures.