The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi,
I have a table which holds data for every part that is produced. When a part is produced, it has a date time stamp (see below):
I have then easily created a visual which shows me the earliest and latest time a part was produced, see below:
How can I calculate the minutes between the earliest and latest shot datetime?
Solved! Go to Solution.
Hi @rebrow31 ,
I think you can try DATEDIFF function in your code.
Calculated column:
Column =
VAR _SECOND = DATEDIFF('Table'[Earliest DateTime],'Table'[Latest DateTime],SECOND)
RETURN
DIVIDE(_SECOND,60)
Measure:
Measure =
VAR _Summarize = SUMMARIZE('Table','Table'[Earliest DateTime],'Table'[Latest DateTime],"Minute", DIVIDE(DATEDIFF('Table'[Earliest DateTime],'Table'[Latest DateTime],SECOND),60))
RETURN
SUMX(_Summarize,[Minute])
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @rebrow31 ,
I think you can try DATEDIFF function in your code.
Calculated column:
Column =
VAR _SECOND = DATEDIFF('Table'[Earliest DateTime],'Table'[Latest DateTime],SECOND)
RETURN
DIVIDE(_SECOND,60)
Measure:
Measure =
VAR _Summarize = SUMMARIZE('Table','Table'[Earliest DateTime],'Table'[Latest DateTime],"Minute", DIVIDE(DATEDIFF('Table'[Earliest DateTime],'Table'[Latest DateTime],SECOND),60))
RETURN
SUMX(_Summarize,[Minute])
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
([Latest DateTime]-[Earliest DateTime])*1440
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
1 | |
1 | |
1 | |
1 |
User | Count |
---|---|
15 | |
12 | |
4 | |
4 | |
2 |