Forum Discussion
Calculate the difference between two hour columns numeric values after certain conditions
- 3 years ago
dbollini , check if this can help
CalculatedColumn =
VAR MaxDate = TODAY()
VAR OneMonthAgo = EOMONTH(MaxDate, -1)RETURN
IF(
'Table'[Active] = 1 &&
'Table'[ApprovalStatusID] IN {5, 7, 8} &&
'Table'[OriginalWorkHours] <> 'Table'[Total Hours] &&
NOT(ISBLANK('Table'[OriginalWorkHours])) &&
'Table'[ApprovalDateTime] > DATEADD(OneMonthAgo, -1, DAY),
'Table'[OriginalWorkHours] - 'Table'[Total Hours],
BLANK()
) - 3 years ago
what happens when you adjust 'Table'[ApprovalDateTime] > DATEADD(OneMonthAgo, -1, DAY) to
'Table'[ApprovalDateTime] > DATEADD('Calendar'[Date], -1, DAY)?
dbollini , check if this can help
CalculatedColumn =
VAR MaxDate = TODAY()
VAR OneMonthAgo = EOMONTH(MaxDate, -1)
RETURN
IF(
'Table'[Active] = 1 &&
'Table'[ApprovalStatusID] IN {5, 7, 8} &&
'Table'[OriginalWorkHours] <> 'Table'[Total Hours] &&
NOT(ISBLANK('Table'[OriginalWorkHours])) &&
'Table'[ApprovalDateTime] > DATEADD(OneMonthAgo, -1, DAY),
'Table'[OriginalWorkHours] - 'Table'[Total Hours],
BLANK()
)
- dbollini3 years agoHelper II
Thank You for Taking time to answer this and i tried various ways
'Table'[ProjectApprovalDate] > DATEADD(PREVIOUSMONTH(Dates[Month]),If i do this it says :-The last argument must be one of these keywords: DAY, MONTH, QUARTER, or YEARandif i do this for previous month it says'Table'[ProjectApprovalDate] > DATEADD(PREVIOUSMONTH(Dates[Month],-1,day),Too many arguments were passed to the PREVIOUSMONTH function. The maximum argument count for the function is 1.and if i try what you put in there 'Table'[ApprovalDateTime] > DATEADD(OneMonthAgo, -1, DAY),then it says incorrect syntaxCan you please check once thanks