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
bouyazbekj
Helper I
Helper I

Help with Switch Function

Hello everyone. 

 

Im the table attached I want to create a "Status" column where I want a switch function to group days outstanding into 4 categories.. 0-50 days, 51-75 days, 76-90 days, 91+ days. See below for example 

 

Invoice numberDays outstandingStatus
20460160-50 Days
20459250-50 Days
2045832 
2045748 
2045650 
204555551-75
2045458 
2045359 
2045270 
2045175 
204507776-90 Days
204499076-90 Days
204489291+ Days
2044799 
2044699 
20445105 
1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

Column = switch(TRUE(), Table1[Days outstanding] < 51, "0 - 50 Days",
                        Table1[Days outstanding] < 76, "51 - 75 Days",
                        Table1[Days outstanding] < 91, "76 - 90 Days", "91 + Days")

Please test it because I just bashed it out without doing so

View solution in original post

1 REPLY 1
HotChilli
Super User
Super User

Column = switch(TRUE(), Table1[Days outstanding] < 51, "0 - 50 Days",
                        Table1[Days outstanding] < 76, "51 - 75 Days",
                        Table1[Days outstanding] < 91, "76 - 90 Days", "91 + Days")

Please test it because I just bashed it out without doing so

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.

Top Solution Authors