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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
hemantsingh
Helper V
Helper V

Difference bewteen Dates in same column in Hours based on filter criterias

Hi all,

 

        I have a dataset, below is the one drive link of the sample datset for better understanding. It has a single date-time column. I need to write a measure that gives me the sum of difference of hours based on Code & labels. The column called "Code" is basically a parent column & has different levels which are located in "Level" column. 

       Need to write a measure that can give me the total time spent on each distinct code in "Code" column and also gives the bifurcation of time spent in hours on various corresponding levels in "Level" Column for the same code.

 

  https://1drv.ms/x/s!At-ypUY12rplbGvt_fEwRTS64Ig

 

CodeTime Spent CodelevelTime Spent
Mech0211000 Mech0211200
   Mech0213150
   Mech0214300
   Mech0215250
   Mech0216100
      
5 REPLIES 5
parry2k
Super User
Super User

@hemantsingh thanks for the sharing the dataset but it is not very clear that how you want time spent to be calculated? Could you please explain with an example?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi @parry2k

 

     Time spent should get calculated in "Hours". All in all i need to show the the "total time spent" in Hours for each "Code". Further, if i bring in Level column than the time spent for each code should get bifurcated in the subsequent portions of time spent in each level that constitutes the Code. 

 

I hope its clear. Leme know if you want futher more clarification or more detailed example.

 

Regards,

Hemant

   

@hemantsingh,

Could you please describe more details about the logic you use to calculate Time spent? Take the highlighted codes for example, what difference do you refer to? Code 420 have 2 levels, do you want to calculate hour difference between the two levels(7/6/2017 4:17:00 PM and 7/8/2017 5:47:11 PM)  in terms of Level scope for each code?
1.PNG

Also in terms of Code level, what hour difference do you want to return for code 420 and code 4545?

Regards,
Lydia

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

@v-yuezhe-msft

 

    YEs...you got it right. I want the time difference for each level for a code.

 

Regards

@hemantsingh,

In terms of Code level, what hour difference do you want to return for code 420 and code 4545? Each code has serveral levels with different datetime, which specific datetime values for code 420 and code 4545 would you like to compare?

Regards,
Lydia

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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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