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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Kareus
Helper I
Helper I

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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