Forum Discussion

nDevasani's avatar
nDevasani
Regular Visitor
9 months ago
Solved

undefinedorting Issue in Gantt Chart Visual in Power BI (Custom Sorting with Job ID)

 

I am facing a sorting issue with the Gantt chart visual in Power BI and would appreciate any help or suggestions on how to resolve it.

Problem Description:

I am using the default Microsoft Gantt chart visual in Power BI to display ETL job runtimes, where each job has a JOB_ID, SEQUENCE_NUMBER, and RUN_DATE associated with it. I need to sort the Gantt chart by JOB_ID in a custom order.

The issue I'm encountering is that, while the jobs are sorted correctly in Power BI Desktop, they are not sorted correctly when published to the Power BI Service. The jobs seem to be sorting randomly based on JOB_ID (the default behavior) or by JOB_START_TIME or JOB_END_TIME in the service, even though they are correctly ordered in Desktop.

What I’ve Tried:

  • I created custom sorting columns (JOB_ID_SORT, JOB_ID_SORT2, and JOB_ID_SORT3) using formulas like: CAST((SEQUENCE_NUMBER * 100 + LEN(JOB_ID)) AS INT) AS JOB_ID_SORT

    But this doesn’t solve the sorting issue in the service.

  • I have also ensured that the column used for sorting is assigned as the Sort Axis for the Gantt chart in Power BI Desktop, but the issue persists in the service.

Key Points:

  • The Gantt chart visual displays multiple jobs, and I need them to be sorted by JOB_ID in a consistent order (with sequence numbers taken into account).

  • In Desktop, the jobs are ordered correctly based on custom sorting columns (JOB_ID_SORT), but in the service, they are not.

  • Sorting seems to default to job start or end time in the service instead of the custom sorting order I set.

Questions:

  1. Is there a way to ensure that custom sorting columns like JOB_ID_SORT work consistently across both Power BI Desktop and Power BI Service?

  2. Are there any best practices or settings I might be missing when dealing with custom sorting for Gantt chart visuals in Power BI?

  3. Does anyone have experience with custom sorting in Gantt charts in Power BI Service and how to ensure the sorting is retained when published?

Any insights or solutions would be greatly appreciated!

Thank you!

 

  • As soon as we select the grouping option, it defaults to sorting by start time, and there’s no way to revert it. I think we might need to wait until they either roll back to the older version or fix it.

     

    we swtitched to Matrix visual.

6 Replies

  • v-achippa's avatar
    v-achippa
    Community Support

    Hi nDevasani,

     

    Thank you for reaching out to Microsoft Fabric Community.

     

    The Gantt chart you are using is a custom visual and custom visuals do not always respect power bi’s Sort by Column settings same in desktop and the service. That is why the order may looks correct locally but it changes after publishing.

    To make the sorting consistent, please create a persisted sort column in your model for example like a numeric Job_Sort based on your sequence, set Job_ID --> Sort by Column --> Job_Sort and then use that field as the Task before publishing. After publishing and refreshing the dataset, the service will follow that order.

     

    Thanks and regards,

    Anjan Kumar Chippa

    • nDevasani's avatar
      nDevasani
      Regular Visitor

      Hi Anjan, v-achippa 

      Thank you for your response. We are already using a persisted Job_ID_Sort column in our model and have set Job_ID → Sort by Column → Job_ID_Sort.

      The issue we are facing appears to be related to the Gantt chart version. We were previously using version 3.0.12.0, where the sorting was working correctly. Recently, the visual was upgraded to 3.2.4.0 in the Power BI Service, and since then, the sorting issue has reappeared.

      We also tried creating a new report with the latest version (3.2.4.0) and deployed it to the service, but the issue persists.

      It seems like the sorting behavior changed in the newer version of the visual, which is causing the inconsistency between Desktop and Service.

       

      4871268 , some one else repoted the same issue.

      • v-achippa's avatar
        v-achippa
        Community Support

        Hi nDevasani,

         

        Thank you for the update. Since you already use a persisted sort column and the issue only started after the Gantt visual upgraded from 3.0.12.0 to 3.2.4.0, this is a regression in the custom visual itself. Power bi desktop may still use the older cached version but the service loads the latest version automatically, which is why the sorting changed.

        Because this is a custom visual, fixes can only be made by the visual’s publisher. So I recommend you to please raise a support ticket for further assistance.
        To raise a support ticket, kindly follow the steps outlined in the following guide:

        Create a Fabric and Power BI Support Ticket - Power BI | Microsoft Learn

         

        Thanks and regards,

        Anjan Kumar Chippa