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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.