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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
ankurmadharia
Regular Visitor

Sort a table by two columns

Is there a way to sort a table by the results of two columns?

 

In the first column I have only the dates. In the second column I have the time. Now I would like to sort the table. At row one I would like to have the earliest date of the first column with the earliest result of the second column.

 

Example:

Thursday, 01 October, 2015      5:00:00 PM 

Saturday, 03 October, 2015       3:30:00 PM

Monday, 05 October, 2015        3:00:00 PM

Thursday, 01 October, 2015      9:00:00 AM

Saturday, 03 October, 2015       4:45:00 PM

Monday, 05 October, 2015        2:00:00 PM

 

After Sorting:

Thursday, 01 October, 2015      9:00:00 AM

Thursday, 01 October, 2015      5:00:00 PM

Saturday, 03 October, 2015       3:30:00 PM

Saturday, 03 October, 2015       4:45:00 PM

Monday, 05 October, 2015        2:00:00 PM

Monday, 05 October, 2015        3:00:00 PM

 

PS: Both are separate columns.

2 REPLIES 2
v-sihou-msft
Microsoft Employee
Microsoft Employee

@ankurmadharia,

 

where do you want to sort this table? under report or data tab?

 

In Power BI desktop, if you want to see sorted table in data view, you can either sort it in query when importing data

 

Capture.PNG

 

Capture2.PNG

 

Or sort it in Query Editor.

 

Capture3.PNG

If you want to sort it under report view, it can't be achieved because the table visual will always aggregate data and sort automatically ingoring the existing sorting.

 

Capture33.PNG

Regards,

achinm45
Advocate IV
Advocate IV

Hi @ankurmadharia,

Please do make 3rd columns which concatenates date and time and then sort results on that.

 

BR,

Achin

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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