Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
VesnaStojTraj
New Member

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 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@VesnaStojTraj , I think you can try

 

calculate(ValueFinal , filter(Table, Table[column] = "ABC")

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@VesnaStojTraj , I think you can try

 

calculate(ValueFinal , filter(Table, Table[column] = "ABC")

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors