Try this.
Need to create a derive table.
Select measure from table_IS
Where ‘IS’ = Prompt(IS/WAS)
Union all
Select measure from table_was
Where ‘was’ = Prompt(IS/WAS)
And create a measure using this derive table
below is the sample code:
Declare
@a asvarchar(4)
set @a='8-10'
select a1.ACT_ID, c1 from(
select count(cs.ACT_ID)as ACT_ID,'2-4'as c1 FROM FACT TABLE cs
where cs.ACT_ID between 200000 and 400000
and'2-4'= @a
unionall
Selectcount(cs.ACT_ID)as ACT_ID,'8-10'as c1
FROM FACT TABLE cs where cs.ACT_ID between 800000 and 1000000
and'8-10'= @a)a1