-1

Error Screenshot

Does anybody here know why is this happening. I have 2 dates column in a table, 'Date of First Contact' and 'Date of Last Activity'. Can someone enlighten me why is this happening? Thank you in Advance

Jj Encrypt
  • 11
  • 5

1 Answers1

0

https://learn.microsoft.com/en-us/dax/datediff-function-dax

DATEDIFF() doesn't accept columns, but single dates. To use this function you would need a row context. So you can either use DATEDIFF()

  • in a calculated column, which results in numbers for every row
  • or in an iterator function like SUMX(), which potentially also aggregates the numbers, depending on the filter context.

You are trying to use DATEDIFF() directly in a measure, which doesn't work.

Peter
  • 10,959
  • 2
  • 30
  • 47
  • Isn't the expression for a calculated COLUMN that is supposed to return a value for each row? "column... may not be used in this expression" How do you force this "row context" to make this simple expression work? Is Power Bi incapable of making this simple calculation? – Hannover Fist Apr 18 '23 at 15:13