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
sanjeewauom
Helper I
Helper I

Display Duration type Columns in Report view and Sort them

I'm a new user to power bi. I have found out that in the report view when we use a graph and use "show data points as a table" only columns of type text will be displayed. I can display numbers, dates and duration type columns by duplicating and coverting them to type text in power query. But the issue is when I use "show data points as a table" the columns with duration data cannot be sorted in ascending or descending. Kindly help.

 

Thanks

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@sanjeewauom , if data type is time, it will sort. If it duration created as text, then create a sort column and mark that as sort column

 

You can do this power query for sort column

sort col=  Duration.Days([D1])*1000000 + Duration.Hours([D1])*10000 + Duration.Minutes([D1])*100 + Duration.Second([D1])*100

 

 

Else create two column in dax

duration 1 = [d1]

Duration sort =  <Create a logic based on format>

 

mark Duration sort as sort column for Duration 1 and use that in visual

 

How to Create Sort Column and Solve Related Errors:
https://www.youtube.com/watch?v=KK1zu4MBb-c

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@sanjeewauom , if data type is time, it will sort. If it duration created as text, then create a sort column and mark that as sort column

 

You can do this power query for sort column

sort col=  Duration.Days([D1])*1000000 + Duration.Hours([D1])*10000 + Duration.Minutes([D1])*100 + Duration.Second([D1])*100

 

 

Else create two column in dax

duration 1 = [d1]

Duration sort =  <Create a logic based on format>

 

mark Duration sort as sort column for Duration 1 and use that in visual

 

How to Create Sort Column and Solve Related Errors:
https://www.youtube.com/watch?v=KK1zu4MBb-c

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Many Thanks for your  reply. I will try it out.

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.