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
Breen
Frequent Visitor

How do I sort a matrix based on a column

Hello, I am trying to replicate this Tableau table in PowerBI: 

Breen_1-1724829305235.png

I'm almost there, but I'm struggling to get that ascending sort, broken down by 2021, working.

 

I've already tried to 'sort by column' using Year, but I receive the error: 

Breen_2-1724829587798.png

 

So I'm out of ideas, can anyone help?

 

5 REPLIES 5
uzuntasgokberk
Super User
Super User

Hello @Breen,

 

Add Column as year in your PowerQuery as number format. Close & Apply.

And select your one required column and sort by column that you added column on power query side.

İf you added a column on dax(new column) that doesn't make sort by columns(Not all columns but some referance columns)

 

Best Regards,
Gökberk Uzuntaş

LinkedIn: https://www.linkedin.com/in/g%C3%B6kberk-uzunta%C5%9F-b43906198/

Medium: https://medium.com/@uzuntasgokberk

 

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

 

Hi, thanks for your comment.

 

Unfortunately, the 'application year string' column can contain the year '2020a', which is going to prevent me from using the number format. What else would you suggest? 

ryan_mayu
Super User
Super User

@Breen 

you can check in the data, if there two columns are one to one relationship. If one value in the column has different corresponding values. Then you can not do the sort by and will get the error message.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi, looks like you're right. How could I resolve this?

 

It's worth me mentioning that 'application year string' can hold strings like '2020a'.

then you have to clean the data and change 2020a to 2020.

Maybe you can provide some sample data, let's see how we can clean your data automatically.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.