How to sort dimension by measure

thecatzika 21 Reputation points
2021-02-05T15:38:41.53+00:00

I use AW Internet Sales DWH (Tabular Model) , I create a measure [%Margin] on FactInternetSales as below

64610-2021-02-05-222701.png

and I want show Margin by ProductName and ProductCategory which sort ProductCategory by Margin on Power BI as below

64579-2021-02-05-223508.png

How I can sort ProductCategory by Margin

SQL Server Analysis Services
SQL Server Analysis Services
A Microsoft online analytical data engine used in decision support and business analytics, providing the analytical data for business reports and client applications such as Power BI, Excel, Reporting Services reports, and other data visualization tools.
1,296 questions
0 comments No comments
{count} votes

Accepted answer
  1. Darren Gosbell 1,471 Reputation points
    2021-02-07T22:13:56.35+00:00

    Currently the Power BI matrix visual only supports sorting vertically on the names or totals, you cannot sort horizontally. So your only option at the moment is to swap your rows and columns. You could post this as a suggestion for a future enhancement at ideas.powerbi.com

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Lukas Yu -MSFT 5,821 Reputation points
    2021-02-08T07:19:19.487+00:00

    In addition to Darren's suggest , another possibility is to sort this table at Report level. You could do this in PBIRS or SSRS design if these products are involved in your BI project.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.