cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
jhendrsn Frequent Visitor
Frequent Visitor

Sort Matrix Column using measure

Hello,

 

I have a matrix with a date column called "Valuation Date" we want to sort the visiual in descending order(newest date first) instead of the default ascending order. The common solution I know or have found is to use the sort by column under modeling, however this isn't an option for us. We have 1 dataset being shared across multiple reports as a PowerBI Dataset. This eliminates the ability to sort by column on the reports.

 

Is there a way to create a measure which would sort the matrix by the valuation date descending rather than ascending or is the only option to use new dataset?

2 REPLIES 2
Community Support Team
Community Support Team

Re: Sort Matrix Column using measure

Hi @jhendrsn 

I make a test as below:

Connect to a Power BI Dataset with Power BI Desktop,

add "date" to "column" field, it is possible to sort "date" column by descending as below:

sort = RANKX(ALL('Table'),CALCULATE(MAX('Table'[date])),,DESC,Dense)
Capture5.JPG
Then format the measure as below, so that it doesn't show in a matrix
Capture6.JPG
 
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
jhendrsn Frequent Visitor
Frequent Visitor

Re: Sort Matrix Column using measure

Hello @v-juanli-msft ,

 

I tried adding this but it only works if there are no rows in the matrix. If you have any row it will no longer sort by the sort measure.

In the two below screen shots I applied the measure the one without a row works, but when you add any row it will no longer sort.

 

SortnotWorking.PNG

SortWorking.PNG

 

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors