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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
jdang
Regular Visitor

Sorting by earliest date for each level of a hierarchy

Hi all,

 

I have data about projects, where the projects have hierarchy levels of Project > Stages > Task Groups > Task, and a deadline for each task.  I've used a matrix visual and written a measure which, combined with conditional formatting, turns it into a gantt chart.  (Cannot use any of the Gantt addins - free ones did not meet my needs and company will not pay for a licence.)

 

This is working well, but the only issue left is that the matrix is sorting the hierarchy alphabetically.  It should sort by the earliest deadline date at each level.  Stages, Task Groups and Tasks can have the same name across different projects, so Sort By Column does not work appropriately.  And I don't want to append anything to the names, like a number.

 

Example of what the data looks like is below - this is heavily simplified mock data but hopefully enough to demonstrate the issue.  It should sort so in project A0001, Setup is the first stage, then Design, etc.  Then within the Design stage, the Task Group should be sorted so Sketching is first, then 3D Model.

 

Any help appreciated! This is my first post so let me know if any more info is needed.  Also happy to use a Power Query based solution rather than DAX is that's more appropriate.

 

Project IDStageTask GroupTaskDeadline
A0001DeliveryClient ReviewTask 121-04-2022
A0001DeliveryClient ReviewTask 223-04-2022
A0001DeliveryShippingTask 119-04-2022
A0001DeliveryShippingTask 220-04-2022
A0001Design3D ModelTask 109-04-2022
A0001Design3D ModelTask 215-04-2022
A0001DesignSketchingTask 111-04-2022
A0001DesignSketchingTask 207-04-2022
A0001Processing3D PrintingTask 115-04-2022
A0001Processing3D PrintingTask 215-04-2022
A0001ProcessingPackagingTask 116-04-2022
A0001ProcessingPackagingTask 216-04-2022
A0001SetupResourcingTask 110-04-2022
A0001SetupResourcingTask 106-04-2022
A0001SetupSpecTask 101-04-2022
A0001SetupSpecTask 205-04-2022
B0002DeliveryClient ReviewTask 101-05-2022
B0002DeliveryClient ReviewTask 203-05-2022
B0002DeliveryShippingTask 129-04-2022
B0002DeliveryShippingTask 230-04-2022
B0002Design3D ModelTask 119-04-2022
B0002Design3D ModelTask 225-04-2022
B0002DesignSketchingTask 121-04-2022
B0002DesignSketchingTask 217-04-2022
B0002Processing3D PrintingTask 125-04-2022
B0002Processing3D PrintingTask 225-04-2022
B0002ProcessingPackagingTask 126-04-2022
B0002ProcessingPackagingTask 226-04-2022
B0002SetupResourcingTask 120-04-2022
B0002SetupResourcingTask 116-04-2022
B0002SetupSpecTask 111-04-2022
B0002SetupSpecTask 215-04-2022

 

0 REPLIES 0

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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