Forum Discussion

BeckyXie's avatar
BeckyXie
New Member
5 months ago
Solved

Matrix Columns Sorting by DAX Measure Value - Need Dynamic Column Order Based on Measure

Hi Team,
I need to sort Matrix columns dynamically​ based on a measure value (Sales), and have this sorting respond to other filters (Product). The columns are "Factory" fields, and I need them ordered from highest to lowest  Sales.
Current Limitation:​ Power BI's "Sort by column" only works on Rows, not Columns. When Factory Name is in the Columns area, how can I apply any dynamic sorting?
 
Ideal format: Factory can dynamicly adjust based on the filter for different product

 

Thank you very much in advance!

  • BeckyXie 

    You might be able to do that with Deneb but it requires custom coding. A workaround is to rank the column header by the sales value and materialize the sales value in a table that holds the rank numbers. Use the rank as the first level in the hiearchy. It is a bit tricky to setup as well. 

     

3 Replies

  • Hi BeckyXie 

    sort by column works both in rows and columns (just checked), see image

     

     

    but I understand what you mean, you want to use a measure for the sorting in a dynamci way and I do not believe what you ask is supported at the moment

     

    You might look for a custom visual that can handle what you ask

     

    If this helped, please consider giving kudos and mark as a solution

    @me in replies or I'll lose your thread

    Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page

    Consider voting this Power BI idea

    Francesco Bergamaschi

    MBA, M.Eng, M.Econ, Professor of BI

  • BeckyXie 

    You might be able to do that with Deneb but it requires custom coding. A workaround is to rank the column header by the sales value and materialize the sales value in a table that holds the rank numbers. Use the rank as the first level in the hiearchy. It is a bit tricky to setup as well.