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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Delal
Frequent Visitor

If the two value is same in a column then check the other column

Hello Everyone,

 

We have the dataset of projects, and each project has their status and start date (In the same table), and we are using the Gantt chart for illustration.

 

We want to sort the projects first based on a specific sequence of status ( END, Pend, HOLD, Work, LOST, RESV, Plan and Wish) and then start date on the timeline. However, I am having a problem with the two projects with the same status.

 

 

For instance;

 

Project NameProject StatusProject Start Date
Project AEND03/03/2014
Project BEND

01/01/2014

 

 

Same_Status.png

 

As you can see, the two projects have the same status, but somehow, the project on above plotted first, but our goal is to plot the below one, because it is started earlier than the above one.


I am looking for a solution that first checks the project's status, and if the two projects have the same status, it plots the project with the earliest start date on the timeline.


I am kindly requesting a support. Thank you for your answers/solutions.

 

 

Regards,

Delal

3 REPLIES 3
v-luwang-msft
Community Support
Community Support

Hi @Delal ,

Test  Sort by column:

When sort by Project name:

vluwangmsft_0-1629353838799.png

vluwangmsft_1-1629353879738.png

And sort by  Project Start date:

vluwangmsft_2-1629353915778.png

vluwangmsft_3-1629353948465.png

 

Wish it is helpful for you!

 

Best Regards

Lucien

 

Hello Lucien,

 

Thank you for your answer, but I am afraid this is not the solution I am looking for. Maybe I should have been more specific.

 

First of all, to illustrate projects, we are using a custom visualization called "xViz Gantt Chart," which allows precisely one sorting. However, I already manipulated this by creating a custom column (with if statements).

 

Custom column I created:

 

if [PRJ Order Category]="Development with no product / customer reference" and [Torque_Level_Based_on_STGR] = "N/A" and [PRJ Status] = "END" then 1

else if [PRJ Order Category]="Development with no product /customer reference" and [Torque_Level_Based_on_STGR] = "N/A" and [PRJ Status] = "PEND" then 2

else if [PRJ Order Category]="Development with no product / customer reference" and [Torque_Level_Based_on_STGR] = "N/A" and [PRJ Status] = "HOLD" then 3

else if [PRJ Order Category]="Development with no product / customer reference" and  [Torque_Level_Based_on_STGR] = "N/A" and [PRJ Status] = "WORK" then 4

else if [PRJ Order Category]="Development with no product / customer reference" and [Torque_Level_Based_on_STGR] = "N/A" and [PRJ Status] = "LOST" then 5

else if [PRJ Order Category]="Development with no product / customer reference" and  [Torque_Level_Based_on_STGR] = "N/A" and [PRJ Status] = "RESV" then 6

else if [PRJ Order Category]="Development with no product / customer reference" and [Torque_Level_Based_on_STGR] = "N/A" and [PRJ Status] = "PLAN" then 7

else if [PRJ Order Category]="Development with no product / customer reference" and [Torque_Level_Based_on_STGR] = "N/A" and [PRJ Status] = "WISH" then 8

// Development with product and customer reference
//----------------N/A------------------------------

else if [PRJ Order Category]="Development with product and customer reference" and [Torque_Level_Based_on_STGR] = "N/A" and [PRJ Status] = "END" then 9

else if [PRJ Order Category]="Development with product and customer reference" and [Torque_Level_Based_on_STGR] = "N/A" and [PRJ Status] = "PEND" then 10

else if [PRJ Order Category]="Development with product and customer reference" and [Torque_Level_Based_on_STGR] = "N/A" and [PRJ Status] = "HOLD" then 11

else if [PRJ Order Category]="Development with product and customer reference" and [Torque_Level_Based_on_STGR] = "N/A" and [PRJ Status] = "WORK" then 12

else if [PRJ Order Category]="Development with product and customer reference" and [Torque_Level_Based_on_STGR] = "N/A" and [PRJ Status] = "LOST" then 13

else if [PRJ Order Category]="Development with product and customer reference" and [Torque_Level_Based_on_STGR] = "N/A" and [PRJ Status] = "RESV" then 14

else if [PRJ Order Category]="Development with product and customer reference" and [Torque_Level_Based_on_STGR] = "N/A" and [PRJ Status] = "PLAN" then 15

else if [PRJ Order Category]="Development with product and customer reference" and [Torque_Level_Based_on_STGR] = "N/A" and [PRJ Status] = "WISH" then 16

As you can see, there is a sequence of numbers. I need to add another "and" statement, which indicates that if the PRJ status is the same, check the earliest one

 

Regards,

Delal

Hi @Delal ,

Could you pls share your detail pbix file? And remember to remove confidential data.

 

Best Regards

Lucien

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors