March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe 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
Hi Guys
How can I design a column which transform every time that's after 7pm to Next days 10am?
I need to create a column about lead reaction time. Which is (Attempt Time - Lead Created Time). However, some Lead Created Time is created after work time, So it can't be use for this calculation. (For example, If a lead is created at 01/01/2021 10:00pm, if a agent response to it at 01/02/2021 10:20am, the response duration will be 12 hours 20 mins. Which is not right.
In order to get the right result I have to set every time thats passed 7pm to 10 am the day after
Your help will be very appraciated!
Thanks in advance
Solved! Go to Solution.
Hi @njxfoster
Try this code to add a new column to your table:
New Column =
Var _PD = time(19,00,00)
Var _SND = time (10,0,0)
Var _Date = DATEVALUE('Table'[Created Date/Time])
Var _Time = TIMEVALUE('Table'[Created Date/Time])
return
if(_Time>_PD,(_Date+1)+_SND,'Table'[Created Date/Time])
output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
Hi @njxfoster
Can you post sample data as text and expected output?
Not enough information to go on;
please see this post regarding How to Get Your Question Answered Quickly:
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
4. Relation between your tables
Appreciate your Kudos!!
LinkedIn:www.linkedin.com/in/vahid-dm/
Basiclly I want to transform every record thats passed 7:00:00PM into 10AM the next day
For example first row is 10/13/2021 8:56:00PM, the record passed 7:00:00PM so after transformation it should be 10/14/2021 10:00:00AM
The fifth record is 2:42:00PM. Its before 7 PM, so it should stay the same
Thank you for your reply!!
Hi @njxfoster
Try this code to add a new column to your table:
New Column =
Var _PD = time(19,00,00)
Var _SND = time (10,0,0)
Var _Date = DATEVALUE('Table'[Created Date/Time])
Var _Time = TIMEVALUE('Table'[Created Date/Time])
return
if(_Time>_PD,(_Date+1)+_SND,'Table'[Created Date/Time])
output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
23 | |
15 | |
12 | |
9 | |
8 |
User | Count |
---|---|
41 | |
32 | |
29 | |
12 | |
12 |