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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Neha_Shukla
Helper I
Helper I

SORTING AS PER SPECIFIC COLUMN

 

Neha_Shukla_1-1646976784074.png

 

3 REPLIES 3
v-jinweili-msft
Microsoft Employee
Microsoft Employee

Hi @Neha_Shukla ,

 

I added a few rows of date and Emp columns to your original table.

1.Merge Complete Date and ActivityTime columns, Modify the date type to Datetime. Then sort directly.

DateTime =
CONVERT ( 'Table'[Complete Date] & " " & 'Table'[ActivityTime], DATETIME )

vjinweilimsft_0-1647335977608.png

2.Create a measure and group by max and min. Change the format.

Total working hours =
VAR _min =
    CALCULATE (
        MIN ( 'Table'[DateTime] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Emp] = MAX ( 'Table'[Emp] ) )
    )
VAR _max =
    CALCULATE (
        MAX ( 'Table'[DateTime] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Emp] = MAX ( 'Table'[Emp] ) )
    )
RETURN
    _max - _min

vjinweilimsft_1-1647336036641.png

 

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

amitchandak
Super User
Super User

@Neha_Shukla , You have two value which is getting the same sort of order that is not allowed

 

Something like this

Column Sort
A 1
B 1
C 2

 

That is not allowed

 

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

Neha_Shukla_0-1646981966402.png

1. I want to sort out activity time column as per latest time entry.

On activity type column there are values containing ( check - in , lunch - time, lunch- over, break- time, end- break , check-out)

2. AS per this activity which are done by employee I want to find out total working hours.

how to solve this.please help me out in this.

thanks in advance.

Helpful resources

Announcements
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.