Forum Discussion
MisterT
10 years agoRegular Visitor
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...
- 10 years ago
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
bazeemuddin
7 years agoFrequent Visitor
I had the Same Problem,
I tried Just creating a new column like this
Num_Days = IF((Tickets[Status] = "CLOSED") || (Tickets[Status] = "RESOLVED"),
DATEDIFF('Tickets'[Reported Date], 'Tickets'[Actual Finish], DAY),
DATEDIFF(Tickets[Reported Date], TODAY(), DAY))
I know you already have a solution, the above one may help using IF and OR
Thanks for reading
Wish you the happiest time.
drwinny
Helper I
5 years agobazeemuddin, Just what I needed, thank you for the help 😀