Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
i have to calculate the Average delay in orders in (days,hours,minutes,seconds)
first i calculated the duration in seconds :
@lawada
I have modified your measure and you use the follwing :
Avg Delay =
var vSeconds =
DIVIDE(
DATEDIFF(orders[Order PlacedDate],orders[In Progress Order Date],SECOND),
Count(Orders[id])
)
var vMinutes=int( vSeconds/60)
var vRemainingSeconds=MOD(vSeconds, 60)
var vHours=INT(vMinutes/60)
var vRemainingMinutes=MOD(vMinutes,60)
var vDays=INT(vHours/24)
var vRemainingHours=MOD(vHours,24)
return
vDays&" Days & "&
vRemainingHours&" Hours & "&
vRemainingMinutes&" Minutes & "&
vRemainingSeconds& " Seconds"
________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
thank you this calculation worked for me, however im getting the seconds with decimilas how can i get rid of the decimals ?
@lawada , you might want to try an interesting trick
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
User | Count |
---|---|
42 | |
28 | |
23 | |
18 | |
15 |
User | Count |
---|---|
54 | |
35 | |
18 | |
18 | |
15 |