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
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
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.