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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Gokul
Helper IV
Helper IV

sort the date

2.png

how to sort the measure (AvgTurnAroundTimeForTask) ???

14 REPLIES 14
themistoklis
Community Champion
Community Champion

On the top right of the table object there are 3 dots.

Click on that one and there is an option to sort the data

as u said it will sort based on the decimal number only...I already sorted based on what u said..

Eg:after 8days next one will be 7hrs.. 

@Gokul Best to send us a sample of the workspace.

You mentioned decimal but i cant see it on the posted image

@themistoklis thanks for ur reply..AvgTurnAroundTimeForTask is a calculated measure which converts minutes to day hr mins ...i want to sort based on "day hr mins" Format..

@Gokul

 

Will be difficult to tell you what's going on if we cant see the objects on the workspace... mask any sensitive data

2.png

avgTurnaroundTime is an calculated measure..i want to sort avgTurnaroundTime in descending order   such that it will be as 9 Days 23 hrs 59 mins and then next with 9 Days 22hrs 55mins..

Hi @Gokul,

 

Have you solved your problem with the suggestion from themistoklis?

 

If you have solved, please accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

 

If you still need help, please share a dummy pbix file which can reproduce the scenario, so that we can help further investigate on it? You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploading.)

 

In addion, is your measure a text type, if it is, I'm afraid that we may not sort the measure directly in Power BI.

 

There are two workarounds you may have a try.

 

1. Change the measure to calculated column and use the feature Sort by columns. You could refer to this similar thread.

 

2. Split your measure with Day and time, we could sort time and whole number type in Power BI.

 

Best Regards,

Cherry

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

Hi @v-piga-msft how can we convert measure to calculated column ... and is it possible to use calculated column as value in matrix visual ?????????

Hi @Gokul,



Hi @v-piga-msft how can we convert measure to calculated column ... and is it possible to use calculated column as value in matrix visual ?????????


If it is convenient, could you please share your formula so that we could help further on it?

 

In addition, we could use calculated column in matrix visual.

 

 

 

 Best Regards,

Cherry

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

hi @v-piga-msft 

when I create a new calculated column as a copy of measure, I am getting only one same value for all records...

 

AvgTurnaroundTimeForPendingTask =
VAR dayNo =
    INT ( AVERAGE ( 'Task Query'[task_pending_datediff_minutes] ) / 1440 )
VAR hourNo =
    INT (
        MOD ( ( AVERAGE ( 'Task Query'[task_pending_datediff_minutes] ) )1440 ) / 60
    )
VAR minuteNO =
    MOD (
        MOD ( ( AVERAGE ( 'Task Query'[task_pending_datediff_minutes] ) )1440 ),
        60
    )
VAR days =
    IF ( dayNo > 1dayNO & " Days "IF ( dayNo = 1dayNO & " Day " ) )
VAR hrs =
    IF (
        hourNo,
        FORMAT ( hourNo"#0" ) & " Hrs ",
        IF ( hourNo = 1FORMAT ( hourNo"#0" ) & " Hr " )
    )
VAR mins =
    IF (
        minuteNO > 1,
        FORMAT ( minuteNo"#0" ) & " Mins",
        IF ( minuteNO = 1FORMAT ( minuteNo"#0" ) & " Min"IF ( minuteNO = 0"" ) )
    )
RETURN
    CONCATENATE ( daysCONCATENATE ( hrsmins ) )

hi @v-piga-msft any idea??

Hi @Gokul,

 

I'm afraid that should be caused by the context.

 

You could modify your fomula like below.

 

 

VAR dayNo =
    INT ( Calculate(AVERAGE ( 'Task Query'[task_pending_datediff_minutes],ALLEXCEPT('Task Query','Task Query'[Column name])) / 1440 )

Here is an example which may help you understand the difference.

 

difference.png

 

If you still need help, please share some data sample and your desired output so that we can help further on it.

 

Best Regards,

Cherry

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

Hi @v-piga-msft @themistoklis

i have added other column (ie) average turnaround time in minutes ....and i turned off the word wrap in column headers and sorted according to that(average turnaround time in minutes) ....

@Gokul

 

I have replicated your data and it works ok on my workspace.

 

2 Steps to do:

1. Click on the three dots --> Sort by --> Select AVGTurnaroundTimeforTask

2. Then Click on the three dots and select Sort descending

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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