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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
M_Chris
Frequent Visitor

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 message that it cannot get sorted as there is no one to one match between KPI's and sorting column, means I have KPI names in one column and the ranking/sorting I would like to see in my matrix table in another column. However there is another dimension P&L, NCE or NCO statement in the columns. 

 

If I try to sort my KPI structure by sorting columns it always tells me it is not possible because there is no one to one match between KPI and sorting, means. is there any possibility to sort by using the first sorting number (eg 19 in my table) for profit in general? 

 

Many thanks!

Chris

 

KPI

Sorting

Profit loss or NCE

value

Orders

1

PL

100

Revenues

2

PL

90

Profit

3

PL

20

Profit

19

NCE

20

Profit

19

NCE

20

Profit

39

NCO

20

FCF

4

PL

40

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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:

vlinyulumsft_0-1731395504112.png

Here’s a screenshot of the error I encountered:

vlinyulumsft_1-1731395504114.png

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.

vlinyulumsft_2-1731395536948.png

 

2.Next, sort the data in ascending order.

vlinyulumsft_3-1731395536950.png

3.Insert an index column.

vlinyulumsft_4-1731395547898.png

 

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

vlinyulumsft_5-1731395547899.png

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

vlinyulumsft_10-1731395611125.png

vlinyulumsft_11-1731395611131.png

 

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.

View solution in original post

3 REPLIES 3
M_Chris
Frequent Visitor

Many thanks. The point is that my model is based on different sources which includes e.g. several times the KPI Profit on different positions with 20'. In my Key data sheet there should only appear one time the profit. 

 

Result might just look like:

Orders 100'

Revenues 90'

Profit 20'

FCF 40'

 

If I try to apply the sorting column to the KPIs which I already have in my model then it gives me the error message that it is not possible as there is no 1-1 relation for KPI to Sorting (as KPI e.g. Profit is in different rows with diffeerent soring numbers due to several sources income statement and balance sheet for example).

Anonymous
Not applicable

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:

vlinyulumsft_0-1731395504112.png

Here’s a screenshot of the error I encountered:

vlinyulumsft_1-1731395504114.png

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.

vlinyulumsft_2-1731395536948.png

 

2.Next, sort the data in ascending order.

vlinyulumsft_3-1731395536950.png

3.Insert an index column.

vlinyulumsft_4-1731395547898.png

 

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

vlinyulumsft_5-1731395547899.png

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

vlinyulumsft_10-1731395611125.png

vlinyulumsft_11-1731395611131.png

 

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.

Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your expected outcome looks like, but I tried to create a sample pbix file like below with adding one more column, combined column, and this can be sorted by the sort column.

 

Jihwan_Kim_0-1731385195169.png

 

 

 


 

    Microsoft MVP




If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.





LinkedIn
Visit my LinkedIn page





Outlook Booking
Schedule a short Teams meeting to discuss your question.




Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

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.

June 2025 community update carousel

Fabric Community Update - June 2025

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