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.
Hi All,
I have 2 column below, I would like to have the diffrence in days hours minutes like 2 days 12 hours 6 minutes... I am new to powerbi, can someone help me to provide me step by step process, I would really appreciate it. Thanks have a good day.
Regards,
Prasanjit
Solved! Go to Solution.
Hi @pswain
In Power Query create a new Conditional Column and subtract Closed Month from Creation Month.
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Creation Month", type datetime}, {"Closed Month", type datetime}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Duration", each [Closed Month]-[Creation Month])
in
#"Added Custom"
Sample file : Duration
Phil
If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.
Proud to be a Super User!
Hi, @pswain ,
You just need to copy this to your new calculated column:
DIFF =
VAR _D = DATEDIFF('YourTable'[Closed Month],'YourTable'[Creation Month],DAY)
VAR _H = DATEDIFF('YourTable'[Closed Month],'YourTable'[Creation Month],HOUR)-_D*24
VAR _M = DATEDIFF('YourTable'[Closed Month],'YourTable'[Creation Month],MINUTE)-_D*24*60-_H*60
RETURN
_D & " days" & _H & " hours" & _M & " minutes"
Best.
Hi, @pswain ,
You just need to copy this to your new calculated column:
DIFF =
VAR _D = DATEDIFF('YourTable'[Closed Month],'YourTable'[Creation Month],DAY)
VAR _H = DATEDIFF('YourTable'[Closed Month],'YourTable'[Creation Month],HOUR)-_D*24
VAR _M = DATEDIFF('YourTable'[Closed Month],'YourTable'[Creation Month],MINUTE)-_D*24*60-_H*60
RETURN
_D & " days" & _H & " hours" & _M & " minutes"
Best.
Hi @pswain
In Power Query create a new Conditional Column and subtract Closed Month from Creation Month.
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Creation Month", type datetime}, {"Closed Month", type datetime}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Duration", each [Closed Month]-[Creation Month])
in
#"Added Custom"
Sample file : Duration
Phil
If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.
Proud to be a Super User!
@pswain ,
Use DATEDIFF function to get the required output.
Regards,
Manikumar
Appreciate your Kudos. Accept as solution if this is helpful
Proud to be a Super User!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
9 | |
8 | |
5 | |
2 | |
2 |
User | Count |
---|---|
13 | |
7 | |
6 | |
2 | |
2 |