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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Jessica_17
Helper IV
Helper IV

User input for each row

I have a table with two columns:

Category (Col A)

Price (Col B)

I want to create a stacked bar chart using these columns.
However, the key requirement is that the order of the category legends in the chart should be dynamic — based on a user-defined sorting order.

The user will assign a sorting number for each category, and the chart should update the legend order accordingly.



Can anyone please help me in this?

1 ACCEPTED SOLUTION

Hi @Jessica_17,

 

Currently power bi does not support direct user input into data model values from the report UI. The power bi report canvas is read only so the users cannot type or change data values like SortOrder dynamically for each row. So the user can't enter the value in UI itself for each category.

 

If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it! 

 

Thanks and regards,

Anjan Kumar Chippa

View solution in original post

10 REPLIES 10
v-achippa
Community Support
Community Support

Hi @Jessica_17,

 

Thank you for reaching out to Microsoft Fabric Community.

 

Based on the requirement, please follow the below steps:

  • Add a SortOrder column to your table like assign a number to each category to define the desired order.
  • In power bi, go to Data view, select the Category column --> click on Sort by Column --> choose SortOrder.
  • In the stacked bar chart use Category as the Legend. Now the legend will appear in the custom sort order which is defined.

 

If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it! 

 

Thanks and regards,

Anjan Kumar Chippa

HI @v-achippa ,

Thanks for that. However, my main requirement is that the user should be able to manually enter or adjust the sorting order for each row directly within the Power BI UI—without relying on external sources like SharePoint, Excel, or manual dataset updates. Is there any way to make the sorting dynamic and editable by the user within the report itself?

Hi @Jessica_17,

 

Currently power bi does not support direct user input into fields like sort order from within the report UI. Users cannot manually change column values like sort order directly inside a visual or dataset in a published report.

 

If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it! 

 

Thanks and regards,

Anjan Kumar Chippa

HI @v-achippa 

Is there any workaorund for it, to make it possible?

Hi @Jessica_17,

 

Yes, we can choose a sort option from a slicer and use DAX to apply sorting dynamically in visuals

  • Create a table with sort options. And then add it as a slicer in the report.
  • Create a measure for example like below to dynamically assign sort values based on the selected sort option:

    DynamicSort =

    SWITCH(

        SELECTEDVALUE('SortOptions'[SortOptionID]),

        1, MAX('YourTable'[SortOrder]),

        2, RANKX(ALL('YourTable'), 'YourTable'[Category],, ASC),

        3, RANKX(ALL('YourTable'), CALCULATE(SUM('YourTable'[Price])),, DESC)

    )

Use this logic to control sorting in the visuals.

 

If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it! 

 

Thanks and regards,

Anjan Kumar Chippa

Hi @Jessica_17,

 

As we haven’t heard back from you, we wanted to kindly follow up to check if the solution I have provided for the issue worked? or let us know if you need any further assistance.
If my response addressed, please mark it as "Accept as solution" and click "Yes" if you found it helpful.

 

Thanks and regards,

Anjan Kumar Chippa

HI @v-achippa 

Thanks for the solution, but unfortunately it did not worked, user wanted to enter value in UI itself for each category, and the chart should change accordingly.

Hi @Jessica_17,

 

Currently power bi does not support direct user input into data model values from the report UI. The power bi report canvas is read only so the users cannot type or change data values like SortOrder dynamically for each row. So the user can't enter the value in UI itself for each category.

 

If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it! 

 

Thanks and regards,

Anjan Kumar Chippa

rajendraongole1
Super User
Super User

Hi @Jessica_17  - Yes, you can definitely achieve dynamic legend ordering in a stacked bar chart in Power BI.

below are some of the solved reference links:

https://community.powerbi.com/t5/Desktop/Sort-legend-for-stacked-column-chart/td-p/2574412

https://community.fabric.microsoft.com/t5/Desktop/Help-with-stacked-bar-chart-editing-legend-order/t...

 

 

Hope this helps.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





HI @rajendraongole1 ,

Thanks for that. However, my main requirement is that the user should be able to manually enter or adjust the sorting order for each row directly within the Power BI UI—without relying on external sources like SharePoint, Excel, or manual dataset updates. Is there any way to make the sorting dynamic and editable by the user within the report itself?

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

May 2025 Monthly Update

Fabric Community Update - May 2025

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