The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I am using Microsoft's Gantt chart. The chart automatically allows me to sort by task name and earliest end date. However, I have two calculated columns that I would also like to sort by. If I place either of these columns in the % completion data role (I have disabled the % completion behaviour) then it converts to a measure, one "sum" and one "count", and I can sort by it in the three dots menu.
The problem is that I can only use one of them at a time. No other data role in the visual will convert to a measure, and the % completion role only accepts one field at a time. I've tried making measures instead of calculated columns, but no other data roles will accept them, because they're measures! This includes under tooltips.
Where in my visual can I place these so that they will appear in the sort menu? Is there another way around this?
Solved! Go to Solution.
Hi @0045321 ,
You're definitely running into a known limitation of the Gantt visual — it only allows sorting by fields that are used in specific roles and interpreted as measures.
Here’s a workaround that might help:
Create a measure version of your calculated column, like:
MySortMeasure = MAX('YourTable'[YourCalculatedColumn])
This forces it into a measure context, which the visual can recognize for sorting.
Place that measure into the % Completion field (since you’ve disabled its default behavior). This will make it appear in the sort menu via the three dots.
Unfortunately, as you mentioned, the % Completion role only accepts one field at a time. If you want to switch between multiple sort fields dynamically, you can use a disconnected table and a slicer to control which measure is active — a technique known as dynamic sorting.
Here are some helpful Microsoft docs that explain sorting behavior in Power BI:
Let me know if you’d like help setting up the dynamic sort logic — happy to walk you through it.
If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.
This response was assisted by AI for translation and formatting purposes.
Thankyou, @burakkaragoz, @RLSmart, for your response.
Hi 0045321,
We appreciate your question on the Microsoft Fabric Community Forum.
From what I understand, the feature you want to use is not fully possible in the current version of the Power BI Gantt visual. The Microsoft Gantt visual does not support sorting by multiple fields. It only allows sorting by certain data roles, and these roles let you sort by only one field at a time. Also, custom visuals have fixed functions, unlike table or matrix visuals where sorting is more flexible.
To solve this, we have created a workaround using a dynamic sorting solution with a disconnected table and a SWITCH measure:
Please find the attached screenshot and sample pbix file for your reference:
We hope this information helps you solve the issue.
If you have any more questions, please feel free to ask in the Microsoft Fabric community.
Thank you.
This is a shortcoming in PBI that I have been giving feedback on for the last 5 years that I have been using it. BusObj could sort on as many columns or rows as were in the matrix (crosstab) 20 years ago and it's stil not available in PBI. Seems like a basic function that is missing.
Hi @0045321 ,
You're definitely running into a known limitation of the Gantt visual — it only allows sorting by fields that are used in specific roles and interpreted as measures.
Here’s a workaround that might help:
Create a measure version of your calculated column, like:
MySortMeasure = MAX('YourTable'[YourCalculatedColumn])
This forces it into a measure context, which the visual can recognize for sorting.
Place that measure into the % Completion field (since you’ve disabled its default behavior). This will make it appear in the sort menu via the three dots.
Unfortunately, as you mentioned, the % Completion role only accepts one field at a time. If you want to switch between multiple sort fields dynamically, you can use a disconnected table and a slicer to control which measure is active — a technique known as dynamic sorting.
Here are some helpful Microsoft docs that explain sorting behavior in Power BI:
Let me know if you’d like help setting up the dynamic sort logic — happy to walk you through it.
If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.
This response was assisted by AI for translation and formatting purposes.