Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

If statement for a calculated column

Hi,   I have a column added into my table which is using a datediff that says how many days between 2 dates , Age =datediff('Table1'[Date A],'Table 1'[Date 2],DAY)   However I am trying to creat...
  • az38's avatar
    6 years ago

    Hi Anonymous 

    if you use DAX calculated column your new column will look like

    Test = MIN([Age], 7) 

    you also can use this technique

    Age = 
    var _dd = datediff('Table1'[Date A],'Table 1'[Date 2],DAY)
    RETURN 
    IF(_dd < 7, 7, _dd)