Forum Discussion
DaxTest11 = DATEDIFF('table'[Date/Time Opened],'table'[First Response],MINUTE) returns odd results
- Anonymous4 years ago
Try this:
My Time to Respond =
VAR StartHour = HOUR(SRInsights-SupportCases'[Date/Time Opened]) VAR EndHour = HOUR(SRInsights-SupportCases'[First Response Date]) RETURN
IF (StartHour > 18 && EndHour < 8, [Whatever formula you need when after 6PM && before 8AM],
(((DATEDIFF('SRInsights-SupportCases'[Date/Time Opened], 'SRInsights-SupportCases'[First Response Date], MINUTE))))
--Nate
Try this:
My Time to Respond =
VAR StartHour = HOUR(SRInsights-SupportCases'[Date/Time Opened]) VAR EndHour = HOUR(SRInsights-SupportCases'[First Response Date]) RETURN
IF (StartHour > 18 && EndHour < 8, [Whatever formula you need when after 6PM && before 8AM],
(((DATEDIFF('SRInsights-SupportCases'[Date/Time Opened], 'SRInsights-SupportCases'[First Response Date], MINUTE))))
--Nate
- kmcardle4 years ago
Helper I
Nate - Thank you. This looks very promising. I will work through all the possible conditions and then give this a try. You're awesome. I am so lost with DEX and Power Query.
Thanks
Kevin
- kmcardle4 years ago
Helper I
Nate, I am having a difficult time trying to understand how to use VAR.
I have tried to use the same in a column as well as a measure but I always get syntax errors.
Would you have a link to a tutorial I can follow to understand what I am doing wrong?
I apologize for not having a better understanding of Power BI.
I appreciate you help for sure!! Thank you