cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kareus
Frequent Visitor

SWITCH ( Once a condition is met, block it meeting another condition)

I am trying to rank our open orders.  Once it meets one of the criteria, I would like to filter the order# so it can't be used to meet another critera.  Anotherwards I want to avoid duplicate order numbers in the same table.  How I presently have it, an order# number can occur in more than one rank.

 

Priority =
SWITCH(
TRUE(),
//TODAY
Sheet1[Shippable]==True() && Sheet1[Useable Schedule Date].[Date]==Sheet1[CurrentDate].[Date] && Sheet1[SB / SC]=="SC" && Sheet1[Parts Class]=="A","RANK1",
Sheet1[Shippable]==True() && Sheet1[Useable Schedule Date].[Date]==Sheet1[CurrentDate].[Date] && Sheet1[SB / SC]<>"SC" && Sheet1[SKUs]==1 && Sheet1[Parts Class]=="A","RANK2",
Sheet1[Shippable]==True() && Sheet1[Useable Schedule Date].[Date]==Sheet1[CurrentDate].[Date] && Sheet1[SB / SC]=="SC" && Sheet1[Parts Class]<>"A","RANK3",
Sheet1[Shippable]==True() && Sheet1[Useable Schedule Date].[Date]==Sheet1[CurrentDate].[Date] && Sheet1[SB / SC]<>"SC" && Sheet1[SKUs]==1 && Sheet1[Parts Class]<>"A","RANK4",
Sheet1[Shippable]==True() && Sheet1[Useable Schedule Date].[Date]==Sheet1[CurrentDate].[Date] && Sheet1[SB / SC]<>"SC" && Sheet1[Kit]="0","RANK5",

//PAST DUE
Sheet1[Shippable]==True() && Sheet1[Useable Schedule Date].[Date]<Sheet1[CurrentDate].[Date] && Sheet1[SB / SC]=="SC" && Sheet1[Parts Class]=="A","RANK6",
Sheet1[Shippable]==True() && Sheet1[Useable Schedule Date].[Date]<Sheet1[CurrentDate].[Date] && Sheet1[SB / SC]<>"SC" && Sheet1[SKUs]==1 && Sheet1[Parts Class]=="A","RANK7",
Sheet1[Shippable]==True() && Sheet1[Useable Schedule Date].[Date]<Sheet1[CurrentDate].[Date] && Sheet1[SB / SC]=="SC" && Sheet1[Parts Class]<>"A","RANK8",
Sheet1[Shippable]==True() && Sheet1[Useable Schedule Date].[Date]<Sheet1[CurrentDate].[Date] && Sheet1[SB / SC]<>"SC" && Sheet1[SKUs]==1 && Sheet1[Parts Class]<>"A","RANK9",
Sheet1[Shippable]==True() && Sheet1[Useable Schedule Date].[Date]<Sheet1[CurrentDate].[Date] && Sheet1[SB / SC]<>"SC" && Sheet1[Kit]="0","RANK10",

//FUTURE "A" CLASS
Sheet1[Shippable]==True() && Sheet1[Useable Schedule Date].[Date]>Sheet1[CurrentDate].[Date] && Sheet1[SB / SC]=="SC" && Sheet1[Parts Class]=="A","RANK11",
Sheet1[Shippable]==True() && Sheet1[Useable Schedule Date].[Date]>Sheet1[CurrentDate].[Date] && Sheet1[SB / SC]<>"SC" && Sheet1[SKUs]==1 && Sheet1[Parts Class]=="A","RANK12",

//TODAY WITH WAREHOUSE 10
Sheet1[Shippable]==False() && Sheet1[Useable Schedule Date].[Date]==Sheet1[CurrentDate].[Date] && Sheet1[WH7/WH10 Complete Order]="WH7/WH10 Complete" && Sheet1[Parts Class]=="A", "RANK13",
Sheet1[Shippable]==False() && Sheet1[Useable Schedule Date].[Date]==Sheet1[CurrentDate].[Date] && Sheet1[WH7/WH10 Complete Order]="WH7/WH10 Complete" && Sheet1[Parts Class]<>"A", "RANK14",
 
//PAST DUE WITH WAREHOUSE 10
Sheet1[Shippable]==False() && Sheet1[Useable Schedule Date].[Date]<Sheet1[CurrentDate].[Date] && Sheet1[WH7/WH10 Complete Order]="WH7/WH10 Complete" && Sheet1[Parts Class]=="A", "RANK15",
Sheet1[Shippable]==False() && Sheet1[Useable Schedule Date].[Date]<Sheet1[CurrentDate].[Date] && Sheet1[WH7/WH10 Complete Order]="WH7/WH10 Complete" && Sheet1[Parts Class]<>"A", "RANK16",

//FUTURE
//Sheet1[Shippable]==True() && Sheet1[Useable Schedule Date].[Date]>Sheet1[CurrentDate].[Date] && Sheet1[SB / SC]=="SC" && Sheet1[Parts Class]<>"A","RANK17",
//Sheet1[Shippable]==True() && Sheet1[Useable Schedule Date].[Date]>Sheet1[CurrentDate].[Date] && Sheet1[SB / SC]<>"SC" && Sheet1[SKUs]==1 && Sheet1[Parts Class]<>"A","RANK18",
//Sheet1[Shippable]==True() && Sheet1[Useable Schedule Date].[Date]>Sheet1[CurrentDate].[Date] && Sheet1[SB / SC]<>"SC" && Sheet1[Kit]="0","RANK19",
"NULL"
)
1 REPLY 1
v-janeyg-msft
Community Support
Community Support

Hi, @Kareus 

 

Could you mind providing some sample data and your desired result with me? So we can help you soon.

 

Best Regards

Janey Guo

 

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

April Update

Check it Out!

Click here to read more about the April 2021 Updates!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

secondImage

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.