Forum Discussion
DATEDIFF, calculate days between today and SQL date field, error
- 7 years ago
Seems like this should be the one:
Age = DATEDIFF(UTCTODAY(), 'Contas correntes de clientes'[dataven], DAY)
Is this a column or a measure?
This is what worked for me in a standard Calendar table:
Column = DATEDIFF(UTCTODAY(), [Date], DAY)
I've tried with this both syntax:
Age = DATEDIFF(UTCTODAY(); 'Contas correntes de clientes'[dataven]; DAY)
and
Age = DATEDIFF(UTCTODAY(), 'Contas correntes de clientes'[dataven], DAY)
And the error now is:
The syntax for ';' is incorrect. (DAX(DATEDIFF(UTCTODAY(); 'Contas correntes de clientes'[dataven]; DAY))).
Seems like this should be the one:
Age = DATEDIFF(UTCTODAY(), 'Contas correntes de clientes'[dataven], DAY)
Is this a column or a measure?
This is what worked for me in a standard Calendar table:
Column = DATEDIFF(UTCTODAY(), [Date], DAY)
- moutinhoabreu7 years agoFrequent VisitorIt’s a column. I was aware of that limitation in measures.
Could it be possible due a direct query limitation on last power bi update ?
Since it was working before
Anyway you’re using DATE field without quotations and on my side when I select a sql field automatically places inside quotation ‘ xxxx ‘- PattemManohar7 years ago
Community Champion
moutinhoabreu The single quotes in your expression is because of Spaces in your table name. It's no harm having single-quotes even if you don't have spaces in your tablename.