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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register 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
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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