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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.