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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
NickDSL
Helper I
Helper I

Sorting a date column by another column not working

Hi so I have the following matrix.

NickDSL_0-1686152703451.png

I would like to sort in the following way based on this dimension table

NickDSL_3-1686152984639.png

 

I go to Sort by Column and select the Base Act Order column but my dates in my matrix do not update to this new ordering.

NickDSL_2-1686152828688.png

In my matrix I have added Period in the left column then, I am trying to sort by Base Act Order.

Is there something I'm doing wrong? Why am I not getting the expected result?

 

1 ACCEPTED SOLUTION
NickDSL
Helper I
Helper I

Found my own janky solution.

 

It was because of date data type.

 

In the query I set the Period/Date column to text type then I was able to sort by my Base Act Order column.

 

I took it a step further and added a conditional column in the query to find columns that begin with 1/1, 2/1, 3/1, etc and added the month name then switched it back to date type after the conditional column step.

My matrix and graphs are now sorting correctly.

NickDSL_0-1686230293607.png


If anyone has a better solution I'd be happy to hear. 

View solution in original post

2 REPLIES 2
v-xinruzhu-msft
Community Support
Community Support

Hi @NickDSL 

You can create a measure

Measure = RANKX(ALLSELECTED('Table'),CALCULATE(SUM('Table'[Column1])),,ASC)

Then close the "Text wrap" of the "Column header" in table visual 

vxinruzhumsft_0-1686275606425.png

 

Then put the measure to the visual and set its width to 0

vxinruzhumsft_1-1686275809216.png

Best Regards!

Yolo Zhu

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

 

 

NickDSL
Helper I
Helper I

Found my own janky solution.

 

It was because of date data type.

 

In the query I set the Period/Date column to text type then I was able to sort by my Base Act Order column.

 

I took it a step further and added a conditional column in the query to find columns that begin with 1/1, 2/1, 3/1, etc and added the month name then switched it back to date type after the conditional column step.

My matrix and graphs are now sorting correctly.

NickDSL_0-1686230293607.png


If anyone has a better solution I'd be happy to hear. 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.