The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Solved! Go to Solution.
Hi @prabhatnath ,
Based on my testing, please try the following methods:
1.Create the sample table.
2.Create the calculated column to calculate days.
Days = NETWORKDAYS('Table'[CreatedDateTime], TODAY()) - 1
3.Create the calculated column to calculate days and hours based on Acknowledge date and created date.
Acknowledge_aver =
VAR days_ = NETWORKDAYS('Table'[CreatedDateTime], 'Table'[AcknowledgeDateTime]) - 1
VAR hour_ = HOUR('Table'[CreatedDateTime])
VAR end_hour = HOUR('Table'[AcknowledgeDateTime])
RETURN
IF(
days_ > 0,
(days_ - 1) * 24 + 24 - hour_ + end_hour,
24-hour_
)
//COUNTROWS(FILTER(CALENDAR('Table'[CreatedDateTime], 'Table'[AcknowledgeDateTime]), WEEKDAY([Date], 2) < 6))))))
4.Create the calculated column to calculate days and hours based on Resolve date and created date.
Resolve_aver =
VAR days_ = NETWORKDAYS('Table'[CreatedDateTime], 'Table'[ResolveDateTime]) - 1
VAR hour_ = HOUR('Table'[CreatedDateTime])
VAR end_hour = HOUR('Table'[ResolveDateTime])
RETURN
IF(
days_ > 0,
(days_ - 1) * 24 + 24 - hour_ + end_hour,
24 - hour_
)
5.Drag the column into the table visual. The result is shown below.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @prabhatnath ,
Based on my testing, please try the following methods:
1.Create the sample table.
2.Create the calculated column to calculate days.
Days = NETWORKDAYS('Table'[CreatedDateTime], TODAY()) - 1
3.Create the calculated column to calculate days and hours based on Acknowledge date and created date.
Acknowledge_aver =
VAR days_ = NETWORKDAYS('Table'[CreatedDateTime], 'Table'[AcknowledgeDateTime]) - 1
VAR hour_ = HOUR('Table'[CreatedDateTime])
VAR end_hour = HOUR('Table'[AcknowledgeDateTime])
RETURN
IF(
days_ > 0,
(days_ - 1) * 24 + 24 - hour_ + end_hour,
24-hour_
)
//COUNTROWS(FILTER(CALENDAR('Table'[CreatedDateTime], 'Table'[AcknowledgeDateTime]), WEEKDAY([Date], 2) < 6))))))
4.Create the calculated column to calculate days and hours based on Resolve date and created date.
Resolve_aver =
VAR days_ = NETWORKDAYS('Table'[CreatedDateTime], 'Table'[ResolveDateTime]) - 1
VAR hour_ = HOUR('Table'[CreatedDateTime])
VAR end_hour = HOUR('Table'[ResolveDateTime])
RETURN
IF(
days_ > 0,
(days_ - 1) * 24 + 24 - hour_ + end_hour,
24 - hour_
)
5.Drag the column into the table visual. The result is shown below.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@prabhatnath , For Networkdays , you can use networkdays function
Power BI - Business day with and without using DAX Function NETWORKDAYS: https://www.youtube.com/watch?v=Qs03ZZXXE_c
https://medium.com/@amitchandak/power-bi-dax-function-networkdays-5c8e4aca38c
For business hours use the blog from Matt -https://exceleratorbi.com.au/calculating-business-hours-using-dax/
could you pls provide some sample data and expected output?
Proud to be a Super User!
User | Count |
---|---|
87 | |
84 | |
36 | |
35 | |
32 |
User | Count |
---|---|
95 | |
75 | |
67 | |
53 | |
52 |