Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Conditional calculation with different unit of measure

Hi,   Can anyone help me achieve the below?    I have these columns in PBi:   Case | Latest comment date | Case type  1 | 03-18-2022 09:56:36 AM | A  2 | 03-19-2022 15:35:23 PM | B  3 | 03-2...
  • johnt75's avatar
    4 years ago

    You could add a calculated column as

    Passed =
    IF( 'Table'[Case type] = "A", DATEDIFF( 'Table'[Latest comment date], NOW(), HOUR) & " hours",
       DATEDIFF( 'Table'[Case type], NOW(), DAY) & " days"
    )

    or if you want to put it in a measure you would need to wrap the column references in SELECTEDVALUES functions