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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.