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

Sort Column data in reverse order in Matrix visual

Hello,

I have the Sales Date in Column section in Matrix visual. I would like to display the recent year to the left (2019, 2018, 2018,...). The dates are in one column and drill-down to Quarter and Month. Please see the attached picture for current result.

column.PNG

3 REPLIES 3
Community Support Team
Community Support Team

Re: Sort Column data in reverse order in Matrix visual

hi, @dsojitra 

For your requirement, you could use Sort by column in Power BI Desktop to get it.

https://radacad.com/sort-by-column-in-power-bi

and for your case, "he dates are in one column and drill-down to Quarter and Month", do you mean that you only darg the date filed in "Columns" as below:

1.JPG

If so, you need to adjust it. you need to add Year, Quarter and Month column separately in edit queries,

and create a reverse order index for year column.

then drag them to "Columns" as below:

2.JPG

 

Now selected Year filed then sort by this reverse order index column.

here is similar post, but it doesn't need drill-down, you could refer to it:

https://community.powerbi.com/t5/Desktop/Matrix-Column-Head-Order/td-p/71572

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
dsojitra Frequent Visitor
Frequent Visitor

Re: Sort Column data in reverse order in Matrix visual

@v-lili6-msft Thank you for your response. Yes, I have the 'SalesDate' field only in Columns section. Could you please provide me the example of creating reverse order index column of a column?

Thanks!

Community Support Team
Community Support Team

Re: Sort Column data in reverse order in Matrix visual

hi, @dsojitra 

You could try these steps:

Step1:

Add a year column in edit queries for [SalesDate],(You could add quarter, Month, and Day column in there too)

2.JPG

Step2:

Then create a reverse order index column for Year column, the simplest way is to create a custom as blow:

-[Year]

3.JPG

4.JPG

Step3:

Then create a matrix use these field instead of [SalesDate] as below:

5.JPG

Step5:

Now selected [Year] filed then click Modeling-Sort->Sort by column->choose [Index]

6.JPG

Result:

7.JPG

and here is sample pbix file, please try it.

 

Regards,

Lin

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

Helpful resources

Announcements
New Ranks and Rank Icons in 2020

New Ranks and Rank Icons in 2020

Read the announcement for more information!

New Kudos Given Badges Coming

New Kudos Given Badges Coming

We're rolling out new Kudos Given badges. Find out how many Kudos you've given.

November 2019 Community Highlights

November 2019 Community Highlights

Get an overview of the events and great community content from November.

Power Platform World Tour

Power Platform World Tour

Find out where you can attend!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)