Forum Discussion

VesnaStojTraj's avatar
VesnaStojTraj
New Member
4 years ago
Solved

Add filter to measure with IF

Hi,

 

I have a complex measure 

ValueFinal = IF(HASONEVALUE(Division1[id]),
        SWITCH(MAX(Division1[id]),
(1), [RevenueD],
(2), [ProdCost21D] + [OtherCost22D],
(3), [GP1D],
(4), [GP1%D]*100,
 
(8), [FTEHardbookedComercialD] + [FTEHardbookedNONComercialD]+ [FTESoftbookedComercialD] + [FTESoftbookedNonComercialD],
)
,
SWITCH(MAX(Query2[nasId]),
(811),[FTEHardbookedComercialD],
(821),[FTEHardbookedNONComercialD],
(8120),[FTESoftbookedComercialD],
(8220),[FTESoftbookedNonComercialD]
)
)
 
As it can be see the IF filter data from two tables, Division1 and Query2.
In table Query2 I have a column RepType with just two values at the moment. I will have up to 4 values in the future.
I don't want to write all measures for 4 times. 
 
Mu question is: Is it posible to add filter to this measure that I have. 
All the represented values are calculated from table Query2.  
 
I was thinking something like:
FinalBudget = ValueFinal (with filter RepType=Budget)
FinalActual = ValueFinal (with filter RepType=Actual)
 
Thank you,
Vesna

1 Reply