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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Adding Extra Fields to Sort Menu

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?

1 ACCEPTED SOLUTION
burakkaragoz
Super User
Super User

Hi @Anonymous ,

 

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:

  1. 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.

  2. 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.

View solution in original post

3 REPLIES 3
v-pnaroju-msft
Community Support
Community Support

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:

  1. Created a disconnected table called SortOptions with options Sort by Priority and Sort by Risk.
  2. Created a DynamicSortMeasure using the SWITCH function based on the slicer selection.
  3. Used that measure in the % Completion role of the Gantt chart.
  4. Now, users can choose which field to sort by using the slicer.
  5. Sorting works as expected when users use the Gantt visual’s context menu by clicking the three dots (⋯) and selecting Sort by DynamicSortMeasure.

Please find the attached screenshot and sample pbix file for your reference:

vpnarojumsft_0-1751965656639.png

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.

RLSmart
Helper I
Helper I

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. 

burakkaragoz
Super User
Super User

Hi @Anonymous ,

 

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:

  1. 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.

  2. 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.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors