willow1985
Well-known Member
- Joined
- Jul 24, 2019
- Messages
- 921
- Office Version
- 365
- Platform
- Windows
I am a beginner in both SQL and DAX. I have been re-creating a Query from Excel into Power BI but writing the calculation for this one column has me stumped and no one at my company knows the program well enough.
Here is the SQL calculation:
The farthest I have got in DAX is below, but have no idea how to do the rest:
Thank you to anyone who can help!
Here is the SQL calculation:
SQL:
ROUND((SELECT SUM(IF(time_resumed = 0, UNIX_TIMESTAMP(), time_resumed) - time_paused) / 86400 FROM erp_workorder_inactive WHERE id_workorder = t1.id_primary)) AS `Paused Days (Total)`
The farthest I have got in DAX is below, but have no idea how to do the rest:
Code:
= Table.AddColumn(#"SubTotal Calc", "Paused Days", each ([winnipeg.erp_workorder_inactive.time_resumed]-[winnipeg.erp_workorder_inactive.time_paused])/86400)
Thank you to anyone who can help!