Forum Discussion

M_Chris's avatar
M_Chris
Frequent Visitor
1 year ago
Solved

Matrix Table - Sorting by column, several KPI"s

Hi Guys,   as you might know I work with a big and given data model from my company. I would like to sort the KPI's by using another column called 'sorting'. Unfortunately I always get the error me...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Thanks for the reply from Jihwan_Kim , please allow me to provide another insight:

    Hi, M_Chris 

    Indeed, as you mentioned, the sorting column must correspond one-to-one with the column being sorted.

    Below is a screenshot from the official documentation for your reference:

    Here’s a screenshot of the error I encountered:

    I recommend using Power Query to regenerate a sorting column. Here’s my proposed solution:

     

    1.First, group the necessary column to retain it and return the maximum value of the sorting column based on the grouping condition.

     

    2.Next, sort the data in ascending order.

    3.Insert an index column.

     

    4.Expand the required columns and remove any unnecessary ones.

    5.This should allow for proper sorting. Below is the final result, which I hope meets your expectations.

     

    Can you share sample data and sample output in tabular format if I am misunderstanding? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.

     

    For questions about uploading data, you can try the following links:

    How to provide sample data in the Power BI Forum - Microsoft Fabric Community

    Solved: How to upload PBI in Community - Microsoft Fabric Community

     

    Please find the attached pbix relevant to the case.

    Best Regards,

    Leroy Lu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.