Forum Discussion
Anonymous
4 years agoNot applicable
Calculating Elapsed Business Hours Using DAX
Hello! Need some help to calculate Business Hours using Dax. I found the solution i almost need here: Calculating Elapsed Business Hours Using DAX Part 2 - Excelerator BI Could you pleas...
- 4 years ago
Hi Anonymous
Try this formula
Business Hours_2 = VAR _Start = 'Incident Fact'[createdon] VAR _End = 'Incident Fact'[Case_Solved] VAR _Country = 'Incident Fact'[Country] VAR _Workhours = SUMX ( CALCULATETABLE ( 'Calendar', DATESBETWEEN ( 'Calendar'[Date], _Start, _End ), SWITCH ( _Country, "Spain", 'Calendar'[Working Day Spain] = 1, "Portugal", 'Calendar'[Working Day Portugal] = 1 ) ), MAX ( MIN ( 'Calendar'[End], _End ) - MAX ( 'Calendar'[Start], _Start ), 0 ) * 24 ) RETURN IF ( _Workhours, _Workhours, 0 )Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Anonymous
2 years agoNot applicable
Hi Alpesh!
maybe this tool can help: https://docs.sqlbi.com/bravo/features/manage-dates/
Let me if it resolves your issue.
Regards,
RT