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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
OpenMike13
Frequent Visitor

Creating Custom Column "status" based on multiple columns.

Hello 

 

Im having issues trying to find a way to create a custom Status column based on multiple other columns within the same table. I am looking to provide a status on a class shipments based on where its at in our shipping process. 

here is how the data is set up in our database 

 

CourseOrder ReceivedDate shippedDate of delivery to courseDate Scheduled for returnDate Returned
XX3/2/20223/5/20223/8/20223/20/202222-Mar
TT4/2/20224/5/20224/8/20224/20/20224/22/2022
AA4/15/20224/18/20224/20/2022  
DD4/18/20224/25/2022   
CC4/27/2022    

 

Here is what the status column should look like

 

CourseOrder ReceivedDate shippedDate of delivery to courseDate Scheduled for returnDate ReturnedStatus
XX3/2/20223/5/20223/8/20223/20/202222-MarCompleted/Returned
TT4/2/20224/5/20224/8/20224/20/20224/22/2022Completed/Returned
AA4/15/20224/18/20224/20/2022  Delivered to Course
DD4/18/20224/25/2022   Shipped to Course
CC4/27/2022    Order Received

 

 

Any help is appreciated! thank you 

1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @OpenMike13 

 

Download example PBIX file

 

This will create your column

 

Status = 

SWITCH(

    TRUE(),

    NOT ISBLANK([Date Returned]), "Completed/Returned",

    NOT ISBLANK([Date of delivery to course]), "Delivered to Course",

    NOT ISBLANK([Date shipped]), "Shipped to Course",

    "Order Received"
)

 

 

status-1.png

 

Note that you don't have any status for something that is scheduled for return, and not yet returned.  But you just need to add another line to the code above for that.

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

1 REPLY 1
PhilipTreacy
Super User
Super User

Hi @OpenMike13 

 

Download example PBIX file

 

This will create your column

 

Status = 

SWITCH(

    TRUE(),

    NOT ISBLANK([Date Returned]), "Completed/Returned",

    NOT ISBLANK([Date of delivery to course]), "Delivered to Course",

    NOT ISBLANK([Date shipped]), "Shipped to Course",

    "Order Received"
)

 

 

status-1.png

 

Note that you don't have any status for something that is scheduled for return, and not yet returned.  But you just need to add another line to the code above for that.

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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