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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Sort by time

Hi there,

 

I am creating a report using Line Chart where I want to show count based on hours.

Can anyone help me to sort out the time in a proper order.

I want it to be like 7 AM, 8AM, 9 AM,10 AM, etc.Power BI.PNG

1 ACCEPTED SOLUTION
Kishore_KVN
Solution Sage
Solution Sage

Hello @Anonymous , 

Follow below steps to achieve this. 

1. In Power Query create two columns. one for time and other for hour (hour column is created from the time column)

2. Make sure the hour column data is from 1-24 instead of AM-PM

3. Once data is loaded to Power BI Desktop, select the time column and sort it using hour column under the option sort by column

4. Use this time column in the visual then it will sort in proper order. 

 

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

View solution in original post

3 REPLIES 3
Kishore_KVN
Solution Sage
Solution Sage

Hello @Anonymous , 

Follow below steps to achieve this. 

1. In Power Query create two columns. one for time and other for hour (hour column is created from the time column)

2. Make sure the hour column data is from 1-24 instead of AM-PM

3. Once data is loaded to Power BI Desktop, select the time column and sort it using hour column under the option sort by column

4. Use this time column in the visual then it will sort in proper order. 

 

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

AbbasG
Memorable Member
Memorable Member

@Anonymous can you share a sample dataset that you are using (after removing sensitive information)

Anonymous
Not applicable

Hi @AbbasG,

 

you can consider this as sample data

TimeLogged Hours
7 AM6
8 AM7
9 AM8
10 AM4
11 AM3
12 PM8
1 PM2
2 PM4

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.