The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have columns of start time and end time in the next format:
yyyy-mm-dd hh:mm
what in need to do if i want to calculate and show the avargte time per day?
i need to do something like that:
sum of (end time - start time) div by Num of Application
how should i do it?
Solved! Go to Solution.
Hi, @Anonymous
Try to create measures like below:
Datediff = DATEDIFF(MAX('Table'[Start Datetime]),MAX('Table'[End Datetime]),MINUTE)
_Sum_Datediff =
sumx(
FILTER(ALL('Table'),EDATE('Table'[Start Datetime],0)=EDATE(MAX('Table'[Start Datetime]),0)),
[Datediff])
_Num of Application = CALCULATE(COUNT('Table'[Application]),FILTER(ALL('Table'),EDATE([Start Datetime],0)=EDATE(MAX('Table'[Start Datetime]),0)))
avargte time per day = [_Sum_Datediff]/[_Num of Application]
Result:
Please refer to the attachment below for details. Hope this helps.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi, @Anonymous
Try to create measures like below:
Datediff = DATEDIFF(MAX('Table'[Start Datetime]),MAX('Table'[End Datetime]),MINUTE)
_Sum_Datediff =
sumx(
FILTER(ALL('Table'),EDATE('Table'[Start Datetime],0)=EDATE(MAX('Table'[Start Datetime]),0)),
[Datediff])
_Num of Application = CALCULATE(COUNT('Table'[Application]),FILTER(ALL('Table'),EDATE([Start Datetime],0)=EDATE(MAX('Table'[Start Datetime]),0)))
avargte time per day = [_Sum_Datediff]/[_Num of Application]
Result:
Please refer to the attachment below for details. Hope this helps.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
@Anonymous , these should be in datetime format
then you can use datediff
in a measure
sumx(Table, datediff([Statdatetime] ,[enddatetime], second) )
You can use minute, hour , day etc