Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreThe FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now
Hi, Since my skills about Power BI are in progress I have a lot of questions, currently I am writting a report that use a lot of business rules and there are some formulas(business rules) that need to be build, for instance: I have a datetime 20180615 10:13:00, do I need to do is to set up the date time to 20180615 07:00:00 and calculate the lapsed time between both datetimes, in this case the lapsed time will be 3:13 hours, well, I am wondering if I can create a Formula and add this formula during the calculation of a column, you can notice that this value will be like a constante, take the daily day and calculate the lapsed time.
Rigoleto
Solved! Go to Solution.
Hi @Rigoleto
Let me show you an example
create a calculated column
column =
CONCATENATE (
CONCATENATE ( DATEDIFF ( [set up time], [datetime1], HOUR ), ":" ),
MOD ( DATEDIFF ( [set up time], [datetime1], MINUTE ), 60 )
)
Or, you can create a measure
Measure =
CONCATENATE (
CONCATENATE (
DATEDIFF ( MAX ( [set up time] ), MAX ( [datetime1] ), HOUR ),
":"
),
MOD ( DATEDIFF ( MAX ( [set up time] ), MAX ( [datetime1] ), MINUTE ), 60 )
)
Best Regards
Maggie
Hi @Rigoleto
Let me show you an example
create a calculated column
column =
CONCATENATE (
CONCATENATE ( DATEDIFF ( [set up time], [datetime1], HOUR ), ":" ),
MOD ( DATEDIFF ( [set up time], [datetime1], MINUTE ), 60 )
)
Or, you can create a measure
Measure =
CONCATENATE (
CONCATENATE (
DATEDIFF ( MAX ( [set up time] ), MAX ( [datetime1] ), HOUR ),
":"
),
MOD ( DATEDIFF ( MAX ( [set up time] ), MAX ( [datetime1] ), MINUTE ), 60 )
)
Best Regards
Maggie
So, yes you could create a measure that does this calculation and then use this measure in other measures or column calculations.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 52 | |
| 44 | |
| 44 | |
| 20 | |
| 19 |
| User | Count |
|---|---|
| 71 | |
| 70 | |
| 34 | |
| 33 | |
| 31 |