Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi there,
I used this thread here: https://community.powerbi.com/t5/Desktop/Calculate-Date-and-Time-difference-considering-the-weekends...
To build a report that calculates working days between ticket create and resolved dates to product mean time to resolve, however I now need to include open tickets in the solution. The problem is, open tickets do not yet have a resolved date, so the last day start time is in 1899 and it skews the stats, as the MTTR is negative.
I've tried doing an IF to switch the last day start to the current day where the ticket is closed:
but I get "expressions that yield variant data type cannot be used to define calculated columns" - all seemingly related to the IF statement.
Please help!
Hi @Anonymous,
Current power bi not allow you direct calculate between different data types(date/text), you can add format function to convert your date values to fix this issue.
Cal_LastDayStartTime =
IF (
'fpscdb002_ws_003 incident'[Cal_Closed] = "Yes",
FORMAT (
DATE ( YEAR ( 'fpscdb002_ws_003 incident'[resolved_date] ), MONTH ( 'fpscdb002_ws_003 incident'[resolved_date] ), DAY ( 'fpscdb002_ws_003 incident'[resolved_date] ) ),
"General Date"
) & " 08:30",
FORMAT (
DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ), DAY ( TODAY () ) ),
"General Date"
) & " 08:30"
)
Best Regards,
Jack
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 37 | |
| 34 | |
| 31 | |
| 27 |
| User | Count |
|---|---|
| 136 | |
| 99 | |
| 73 | |
| 66 | |
| 65 |