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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
mmh
Helper I
Helper I

Swithc function with NOT operator

HI, I have following calculated column with switch function where last part with NOT operator giving incorrect result. Any suggestion !
 
Contract_details =
SWITCH(
    true(),
    accountContract[ContractType_Id] IN {896,3430}  &&  AccountContract[status_Id]IN {566,2664,100246},"FCL_Contracts",
    accountContract[ContractType_Id] IN {895,1398}  &&  AccountContract[status_Id]IN {566,2664,100246},"Rental_Contracts",
    Not (AccountContract[status_Id] IN {565,567,1295}), "total_Contract", --  this part generating  wrong result
    "Unknown"
)
 
Thank You!
BR
mmh
1 ACCEPTED SOLUTION
latimeria
Solution Specialist
Solution Specialist

Hi @mmh ,

Switch function stop evaluating when a condition is met. So , if contract 566 => fcl_contract and it will never be included in total_contract.

View solution in original post

1 REPLY 1
latimeria
Solution Specialist
Solution Specialist

Hi @mmh ,

Switch function stop evaluating when a condition is met. So , if contract 566 => fcl_contract and it will never be included in total_contract.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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