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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.