Forum Discussion

jamoroso's avatar
jamoroso
Helper I
3 years ago
Solved

Sorting within a Matrix visual

Hi, I am trying to create and sort a matrix style visual, but cannot get it to work. I need to recreate this in Power BI in the order in this visual. There is sample data below. Thank you.  -Janet ...
  • v-jingzhang's avatar
    3 years ago

    Hi jamoroso 

     

    I created a matrix like below based on your sample data. Not completely consistent with your expected output but the sorting orders are as expected. Can this meet your need? 

     

    I have attached the sample pbix file at bottom. You can see detailed steps in it. 

     

    Main steps include two parts: 

    1. Use Group by feature in Power Query Editor to add three sorting columns for "Account", "Detail" and "Range or Term" columns individually based on the existing "Sort order" column. Grouping or summarizing rows - Power Query

    2. Apply the changes to Power BI Desktop. Then sort "Account" column by "Account Sort", sort "Detail" by "Detail Sort" and sort "Range or Term" by "RangeTerm Sort". Sort one column by another column in Power BI - Power BI

     

    After you add columns to the matrix visual, sort data by "Account" column ascendingly. 

     

    Hope this helps. 

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.