Forum Discussion

MisterT's avatar
MisterT
Regular Visitor
10 years ago
Solved

Custom Column, DATEDIFF, TODAY....nothing works?

So this is driving me a bit crazy.  Something that should be so simple is taking so long to solve and none of the forum suggestions I've seen work.   And I know I can solve this by adding columns i...
  • Eric_Zhang's avatar
    10 years ago

    MisterT

     

    You can try the below exprssion in DAX but not in Power Query.

    elapsedDays = DATEDIFF( [EmailDate],TODAY() , DAY)

     



     

    And I know I can solve this by adding columns into the underlying database (or adding views) but I don't want to do that and it kind of defeats the purpose of a BI tool surely.


    Or even directly in the query, no need to add columns to the underlying table.

    select emaildate,datediff(day,emaildate,getdate()) elapsedDays from testdb.dbo.tableDate